IctudDownState() returns the lower-limit completion state of the Up/Down counter.
bool IctudDownState(uint8_t counter_id)
| Command | Arguments | Return Value | Operation |
|---|---|---|---|
IctudDownState(counter_id) | uint8_t counter_id — Counter number. Supports 0 ~ 255, the uint8_t range | bool | Returns the lower-limit completion state of the Up/Down counter. |
This example uses the P0 and P1 inputs and the P33 output on MPINO-8A4R(T)-S.
const uint8_t COUNTER_ID = 5; const int32_t RACK_CAPACITY = 100; void setup() { Serial.begin(115200); } void loop() { const bool entered = digitalRead(0) == HIGH; const bool exited = digitalRead(1) == HIGH; Ictud(COUNTER_ID, entered, exited, false, false, RACK_CAPACITY); // Process up and down inputs with one counter. const bool rackEmpty = IctudDownState(COUNTER_ID); // Return the up/down counter's lower-limit completion state. digitalWrite(33, rackEmpty ? HIGH : LOW); }
uint8_t, so the maximum ID is 255.false or 0.