en-us_commands:plc_timer
This is an old revision of the document!
PLC-Style Timers
| Command | Operation |
|---|---|
Iton(id, state, ms) | Turns the output ON when the input has remained ON for the preset time. |
Itof(id, state, ms) | Turns the output OFF after the preset time has elapsed since the input turned OFF. |
Itpl(id, state, ms) | Outputs for the preset time starting at the input rising edge. |
Itmon(id, state, ms) | A monostable pulse that is not extended by another input during execution. |
Itmr(id, state, ms, reset) | Accumulates ON time and clears it with reset. |
IgetTime(id) | Returns the timer's elapsed time. |
IgetState(id) | Returns the timer's output state. |
void loop() { bool run = Ibounce(0, 30); digitalWrite(64, Iton(0, run, 1000)); }
Command Prototypes
| Return Type | Command Prototype |
|---|---|
bool | Iton(uint8_t timer_id, bool state, unsigned long delayTime) |
bool | Itof(uint8_t timer_id, bool state, unsigned long delayTime) |
bool | Itpl(uint8_t timer_id, bool state, unsigned long delayTime) |
bool | Itmon(uint8_t timer_id, bool state, unsigned long delayTime) |
bool | Itmr(uint8_t timer_id, bool state, unsigned long delayTime, bool reset = false) |
unsigned long | IgetTime(uint8_t timer_id) |
bool | IgetState(uint8_t timer_id) |
These commands do not pause the program. Call them on every loop() iteration and use a unique id for each timer.
en-us_commands/plc_timer.1788785565.txt.gz · Last modified: by 127.0.0.1
