A non-blocking replacement for Arduino's delay() function (which is disabled by Mozzi). More...
Public Member Functions | |
EventDelay () | |
Constructor. | |
void | set (unsigned int delay_milliseconds) |
Set the delay time. | |
void | start () |
Start the delay. | |
void | start (unsigned int delay_milliseconds) |
Set the delay time and start the delay. | |
bool | ready () |
Call this in updateControl() or updateAudio() to check if the delay time is up. |
A non-blocking replacement for Arduino's delay() function (which is disabled by Mozzi).
EventDelay can be set() to wait for a number of milliseconds, then after calling start(), calling ready() will return true when the time is up.
update_rate | is how frequently you'll check if the EventDelay is ready(). This would be CONTROL_RATE if ready() is used simply in updateControl(). |
Definition at line 33 of file EventDelay.h.
EventDelay< UPDATE_RATE >::EventDelay | ( | ) | [inline] |
Constructor.
Declare an EventDelay object with UPDATE_RATE template parameter. UPDATE_RATE is how frequently you'll check if the EventDelay is ready(). This would be CONTROL_RATE if ready() is used simply in updateControl().
Definition at line 42 of file EventDelay.h.
bool EventDelay< UPDATE_RATE >::ready | ( | ) | [inline] |
Call this in updateControl() or updateAudio() to check if the delay time is up.
Definition at line 84 of file EventDelay.h.
void EventDelay< UPDATE_RATE >::set | ( | unsigned int | delay_milliseconds | ) | [inline] |
Set the delay time.
This setting is persistent, until you change it by using set() again.
delay_milliseconds | delay time in milliseconds. |
Definition at line 52 of file EventDelay.h.
void EventDelay< UPDATE_RATE >::start | ( | ) | [inline] |
Start the delay.
Definition at line 63 of file EventDelay.h.
void EventDelay< UPDATE_RATE >::start | ( | unsigned int | delay_milliseconds | ) | [inline] |
Set the delay time and start the delay.
delay_milliseconds | delay time in milliseconds. |
Definition at line 73 of file EventDelay.h.