User Tools

Site Tools


en-us_commands:reference:ictud

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en-us_commands:reference:ictud [2026/09/07 23:35] – 바깥 편집 127.0.0.1en-us_commands:reference:ictud [2026/09/14 20:30] (current) – external edit 127.0.0.1
Line 14: Line 14:
  
 ===== Example ===== ===== Example =====
 +
 +This example uses the P0 through P3 inputs and the P32 output on MPINO-8A4R(T)-S.
  
 <code cpp> <code cpp>
Line 24: Line 26:
  
 void loop() { void loop() {
-  const bool entered = IdigitalRead(0, 5);  // Read the input repeatedly and update only if all samples match. If HIGH and LOW are mixed, retain the previous stable state. +  const bool entered = digitalRead(0) == HIGH; 
-  const bool exited = IdigitalRead(1, 5);  // Read the input repeatedly and update only if all samples match. If HIGH and LOW are mixed, retain the previous stable state. +  const bool exited = digitalRead(1) == HIGH; 
-  const bool reset = IdigitalRead(2, 5);  // Read the input repeatedly and update only if all samples match. If HIGH and LOW are mixed, retain the previous stable state. +  const bool reset = digitalRead(2) == HIGH; 
-  const bool preset = IdigitalRead(3, 5);  // Read the input repeatedly and update only if all samples match. If HIGH and LOW are mixed, retain the previous stable state.+  const bool preset = digitalRead(3) == HIGH;
   const bool full = Ictud(COUNTER_ID, entered, exited, reset, preset, RACK_CAPACITY);  // Process up and down inputs with one counter.   const bool full = Ictud(COUNTER_ID, entered, exited, reset, preset, RACK_CAPACITY);  // Process up and down inputs with one counter.
   digitalWrite(32, full ? HIGH : LOW);   digitalWrite(32, full ? HIGH : LOW);
Line 38: Line 40:
   * 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:igetcount|IgetCount() View detailed description]]
 +  * [[:en-us_commands:reference:isetcount|IsetCount() View detailed description]]
 +  * [[:en-us_commands:reference:ictuddownstate|IctudDownState() View detailed description]]
  
 [[:en-us_commands:builtin|← Built-in Command List]] [[:en-us_commands:builtin|← Built-in Command List]]
  
en-us_commands/reference/ictud.1788791734.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki