| Mozzi version v1.1.0 sound synthesis library for Arduino |

Public Member Functions | List of all members
RCpoll< SENSOR_PIN > Class Template Reference

A class for reading voltage on a digital pin, derived from http://arduino.cc/en/Tutorial/RCtime. More...

`#include <RCpoll.h>`

## Public Member Functions
| RCpoll ()
| Constructor.
unsigned int | next ()
| Checks whether the capacitor has charged, and returns how long it took for the most recent charge. More...

## Detailed Description

### template<unsigned char SENSOR_PIN>
class RCpoll< SENSOR_PIN >

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.

Definition at line 12 of file RCpoll.h.

## Member Function Documentation

## ◆ next()

template<unsigned char SENSOR_PIN>

unsigned int RCpoll< SENSOR_PIN >::next | ( |  | ) |
| 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().

Returns
  the sensor value, reflected in how many checking cycles it took to charge the capacitor.

Definition at line 29 of file RCpoll.h.