Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Using the PWM is the hard way to communicate binary data between device, in lieu of the other more readily available peripherals, but doable. Basically PCM or Pulse Code Modulation. The simplest way for this would be the length of time the pin is asserted, represents the data. Which for example is what happens for servo's. Where the PWM is repeating the same length of time that represents a known position and the Servo's receiver converts the length of the pulse back to position or data.</p> <p>The reception of PWM is not typical for Arduino users, But the AVR micro is more than capable of this. There are two possible ways to capture such pulses duration. First and common to Arduion is the <a href="http://arduino.cc/en/Reference/PulseIn" rel="nofollow">PulseIn()</a> function. Where this function is not real time. It simply time stamps the cycle between pulses and limited to duration of only a few microseconds. I believe there are others variations that may go longer. This can work very good. but may have issues with other interrupts such as Serial functions and timers.</p> <p>Another method is known as Input Capture Interrupt. The following GISTHUB <a href="https://gist.github.com/mpflaga/4404996" rel="nofollow">INputCapture.ino</a> is an example of such code that I salvaged from another source. Being not typical, the code is not written as a Arduino Library. But does very accurately captures the length of a pulse. In short the Input Capture pin hardware locks on the system clock on trigger and then at some latent time it can be read. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload