Go Down

Topic: ???PWM as an input??? (Read 1 time) previous topic - next topic

necrokid

Is it possible to have PWM as an input? If so do you have code I can look at?

retrolefty

Sure you can. You can utilize the PulseIn command. Basically you first measure the LOW value and then the HIGH value. Then you can calculate the percentage of ON value, and there you have a PWM input evaluation. There may be code examples in the Arduino playground area, but here is the pulseIn def:

http://arduino.cc/en/Reference/PulseIn

Lefty

necrokid

Thanks I was looking through the learning/ reference sections for PWM in, which explains why I didn't find anything.

Go Up