See also:
- ArduinoProps sketch
- Prop class reference
- PropData class reference
PropAction (see PropAction.h
) brings asynchronous-like behavior to sketch loop()
.
PropAction()
PropAction(unsigned long interval, void (*function)())
function
is the callback executed at every interval
milliseconds.
void reset(unsigned long interval)
void disable()
void enable()
void check()
bool tick()
unsigned long getInterval()
void clignote()
{
if (clignoter.value()) {
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
led.setValue(digitalRead(LED_BUILTIN));
}
}
PropAction clignoteAction = PropAction(1000, clignote); // interval every 1000 milliseconds
void loop()
{
...
clignoteAction.check(); // do your stuff, don't freeze the loop with delay() calls
...
}
Faure Systems (Oct 18th, 2019)
- company: FAURE SYSTEMS SAS
- mail: dev at faure dot systems
- github: fauresystems
- web: Faure Systems