PWM as analogue input
soulcalibre
Posts: 2
Is there any way of using PWM as an input, rather than just an output?
We have an IR receiver, and we wish to use it as an analogue sensor, rather than a digital one. We've only found a way to use PWM as an output though.
Any help? :cool:
We have an IR receiver, and we wish to use it as an analogue sensor, rather than a digital one. We've only found a way to use PWM as an output though.
Any help? :cool:
Comments
Not sure which pin should be which though. What we've done is replace "rct" with the pin # of one of our IR sensors. Are we at least on the right path, or completely messed up?
Build the circuit shown in the application note and try the program shown. Experiment with different voltages, then maybe try it with your IR sensor and see what happens. Only then should you change the circuit around to fit your project. It's generally a bad idea to change someone's demo circuit / program unless you understand it. You can usually add DEBUG statements to look at temporary or intermediate values (like rct) to help you understand what's happening. You can also use a multimeter or oscilloscope to look at the signals themselves.