Quote:
Originally Posted by ay2b
I just thought of this:
Maybe the Ultrasonic class, two I/O pins and a diode would solve the problem: Charge the cap through a diode from an output pin. This corresponds to the "ping" in the Ultrasonic class. When the output pin goes low, the diode prevents the cap from being discharged by the output pin, and the input pin can be used to measure the discharge rate.
Thoughts?
|
Sounds like you are on the right track to me. Personally, I'd use a FET instead of a diode to eliminate the .6V, but it likely doesn't matter.
Out of curiosity, what sensor are you using? Datasheet link please!