How would i set about reading PWM signals with the Arduino
and converting them into a more easily used format (like a number from 0 to 180).
Thanks
Tim
How would i set about reading PWM signals with the Arduino
and converting them into a more easily used format (like a number from 0 to 180).
Thanks
Tim
https://www.arduino.cc/en/Tutorial/PWM is how and quite easy to create a PWM. But you asked how to read. This is much harder since we have to talk about rising and falling edges. A good look is http://www.benripley.com/diy/arduino/three-ways-to-read-a-pwm-signal-with-arduino/ Once you say use method one, you need to convert that into a 0-180 scale by saying 100% equal 180 and 0% equal 0 over a fixed time domain. Another more interesting way using an Arduino is Arduino - SecretsOfArduinoPWM . But this is hardware specific.
Clem
https://www.arduino.cc/en/Tutorial/PWM is how and quite easy to create a PWM. But you asked how to read. This is much harder since we have to talk about rising and falling edges. A good look is http://www.benripley.com/diy/arduino/three-ways-to-read-a-pwm-signal-with-arduino/ Once you say use method one, you need to convert that into a 0-180 scale by saying 100% equal 180 and 0% equal 0 over a fixed time domain. Another more interesting way using an Arduino is Arduino - SecretsOfArduinoPWM . But this is hardware specific.
Clem
It works!
I used method one and it is a vary small amount of code.
Tim