Go Down

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


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


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:




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

Go Up