User Tools

Site Tools


en-us_commands:reference:isetcount

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:isetcount [2026/09/07 21:52] – 만듦 - 바깥 편집 127.0.0.1en-us_commands:reference:isetcount [2026/09/08 00:53] (current) – 바깥 편집 127.0.0.1
Line 16: Line 16:
  
 <code cpp> <code cpp>
-bool Ictu(uint8_t counter_id, bool CU, bool RESET, int32_t PV)+const uint8_t COUNTER_ID = 4; 
-bool Ictd(uint8_t counter_id, bool CD, bool LOAD, int32_t PV); +const uint8_t PRESET_BUTTON_PIN = 0; 
-bool Ictud(uint8_t counter_id, bool CU, bool CD, bool RESET, bool LOAD, int32_t PV); +const int32_t PRESET_COUNT = 25
-int32_t IgetCount(uint8_t counter_id); + 
-void IsetCount(uint8_t counter_idint32_t value); +void setup() { 
-bool IctudDownState(uint8_t counter_id);+  Serial.begin(115200); 
 +
 + 
 +void loop() { 
 +  const bool presetButton = digitalRead(PRESET_BUTTON_PIN== HIGH
 +  static bool previousButton = false; 
 + 
 +  if (presetButton && !previousButton{ 
 +    IsetCount(COUNTER_IDPRESET_COUNT);  // Change the specified counter's current value. 
 +    Serial.println(F("counter preset to 25")); 
 +  } 
 +  previousButton = presetButton; 
 +}
 </code> </code>
  
Line 29: Line 41:
   * 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: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/isetcount.1788785568.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki