User Tools

Site Tools


en-us_commands:reference:ictuddownstate

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en-us_commands:reference:ictuddownstate [2026/09/07 21:52] – 만듦 - 바깥 편집 127.0.0.1en-us_commands:reference:ictuddownstate [2026/09/14 20:30] (current) – external edit 127.0.0.1
Line 14: Line 14:
  
 ===== Example ===== ===== Example =====
 +
 +This example uses the P0 and P1 inputs and the P33 output on MPINO-8A4R(T)-S.
  
 <code cpp> <code cpp>
-bool Ictu(uint8_t counter_id, bool CU, bool RESET, int32_t PV); +const uint8_t COUNTER_ID = 5; 
-bool Ictd(uint8_t counter_id, bool CD, bool LOAD, int32_t PV); +const int32_t RACK_CAPACITY = 100; 
-bool Ictud(uint8_t counter_idbool CUbool CDbool RESETbool LOADint32_t PV); + 
-int32_t IgetCount(uint8_t counter_id); +void setup() { 
-void IsetCount(uint8_t counter_idint32_t value); +  Serial.begin(115200); 
-bool IctudDownState(uint8_t counter_id);+
 + 
 +void loop() { 
 +  const bool entered = digitalRead(0) == HIGH; 
 +  const bool exited = digitalRead(1== HIGH
 +  Ictud(COUNTER_IDenteredexitedfalsefalseRACK_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(33rackEmpty ? HIGH : LOW); 
 +}
 </code> </code>
  
Line 29: Line 39:
   * If insufficient memory prevents allocation of counter state, counter commands return ''false'' or ''0''.   * If insufficient memory prevents allocation of counter state, counter commands return ''false'' or ''0''.
   * Once created, counter state is retained while the program runs.   * Once created, counter state is retained while the program runs.
 +
 +===== Built-in Commands in the Same Category =====
 +
 +  * [[:en-us_commands:reference:ictu|Ictu() View detailed description]]
 +  * [[:en-us_commands:reference:ictd|Ictd() View detailed description]]
 +  * [[:en-us_commands:reference:ictud|Ictud() View detailed description]]
 +  * [[:en-us_commands:reference:igetcount|IgetCount() View detailed description]]
 +  * [[:en-us_commands:reference:isetcount|IsetCount() View detailed description]]
  
 [[:en-us_commands:builtin|← Built-in Command List]] [[:en-us_commands:builtin|← Built-in Command List]]
  
en-us_commands/reference/ictuddownstate.1788785567.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki