![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Provides a mechanism to trigger actions at a specified frequency. More...
#include <TimeStep.h>
Public Member Functions | |
TimeStep (float frequency) | |
Constructor to initialize TimeStep with a frequency. | |
void | SetFrequency (float frequency) |
Sets the frequency for the TimeStep. | |
bool | IsReady () |
Checks if the specified time interval has elapsed. | |
Private Attributes | |
unsigned long | previousMillis |
Stores the last recorded time in milliseconds. | |
uint16_t | updateInterval |
Interval in milliseconds between updates. | |
Provides a mechanism to trigger actions at a specified frequency.
Definition at line 18 of file TimeStep.h.
Constructor to initialize TimeStep with a frequency.
frequency | The frequency in Hz. |
Definition at line 3 of file TimeStep.cpp.
References SetFrequency().
bool IsReady | ( | ) |
Checks if the specified time interval has elapsed.
Definition at line 11 of file TimeStep.cpp.
References previousMillis, and updateInterval.
Referenced by APDS9960::isBooped(), HeadsUpDisplay::Update(), MicrophoneFourier::Update(), MMC56X3::Update(), and ProtogenProject::UpdateFace().
Sets the frequency for the TimeStep.
frequency | The new frequency in Hz. |
Definition at line 7 of file TimeStep.cpp.
References updateInterval.
Referenced by MicrophoneFourier::Initialize(), and TimeStep().
Stores the last recorded time in milliseconds.
Definition at line 20 of file TimeStep.h.
Referenced by IsReady().
|
private |
Interval in milliseconds between updates.
Definition at line 21 of file TimeStep.h.
Referenced by IsReady(), and SetFrequency().