A class for reading voltage on a digital pin, derived from http://arduino.cc/en/Tutorial/RCtime. More...
#include <CapPoll.h>
A class for reading voltage on a digital pin, derived from http://arduino.cc/en/Tutorial/RCtime.
This is designed to be used in updateControl(). Each time it is called, it checks if a capacitor has charged, and returns an output reflecting how long it took for the most recent charge.
Public Member Functions | |
CapPoll () | |
Constructor. | |
unsigned int | next () |
Checks whether the capacitor has charged, and returns how long it took for the most recent charge. More... | |
|
inline |
Checks whether the capacitor has charged, and returns how long it took for the most recent charge.
This would preferably be called in updateControl(), but if the resolution isn't fine enough or the pin charges too fast for updateControl() to catch, try it in updateAudio().