en-us_commands:reference:ictu
This is an old revision of the document!
Table of Contents
Ictu()
Ictu() counts input rising edges and returns true when the preset value is reached.
bool Ictu(uint8_t counter_id, bool CU, bool RESET, int32_t PV)
Commands
| Command | Arguments | Return Value | Operation |
|---|---|---|---|
Ictu(counter_id, CU, RESET, PV) | uint8_t counter_id — Counter number. Supports 0 ~ 255, the uint8_t rangebool CUbool RESETint32_t PV — Preset value | bool | Counts input rising edges and returns true when the preset value is reached. |
Example
void loop() { bool pulse = digitalRead(0); if (Ictu(40, pulse, false, 10)) { digitalWrite(13, HIGH); } }
Precautions
- The previous fixed 0~31 restriction has been removed. However, the argument type is
uint8_t, so the maximum ID is255. - If insufficient memory prevents allocation of counter state, counter commands return
falseor0. - Once created, counter state is retained while the program runs.
en-us_commands/reference/ictu.1788785566.txt.gz · Last modified: by 127.0.0.1
