User Tools

Site Tools


en-us_commands:digital_filter

Differences

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

Link to this comparison view

en-us_commands:digital_filter [2026/09/07 21:52] – 만듦 - 바깥 편집 127.0.0.1en-us_commands:digital_filter [2026/09/12 23:27] (current) – 바깥 편집 127.0.0.1
Line 1: Line 1:
-====== Digital Input Filters ======+====== Digital input filters ======
  
-''IdigitalRead()'' and the ''Ibounce'' commands reduce brief input noise and switch chatter.+Use these functions when an input signal needs filtering.
  
-^ Command ^ Arguments ^ Return Value ^ Operation ^ +  * [[:en-us_commands:reference:idigitalread|IdigitalRead()]] — Reads the input several times consecutively and updates the state only when all values match. If HIGH and LOW are mixed, it retains the previous stable state. 
-[[:en-us_commands:reference:idigitalread|IdigitalRead(pin, samples)]] | Pin number, repetition count | ''HIGH'' or ''LOW''Reads the input several times consecutively and updates the state only when all values match. If HIGH and LOW are mixed, it retains the previous stable state. | +  * [[:en-us_commands:ibounce|Ibounce()]] — Applies a debounce time in both ON and OFF directions of the input
-''Ibounce(pin, ms)'' | Pin number, stable time (ms) | Stabilized state | Applies a time filter in both ON and OFF directions. | +  * [[:en-us_commands:reference:ibounceon|IbounceOn()]] — Applies the time filter only when the input changes from OFF to ON. 
-''IbounceOn(pin, ms)'' | Pin number, stable time (ms) | Filtered state | Delays only the OFFON transition| +  * [[:en-us_commands:reference:ibounceoff|IbounceOff()]] — Applies the time filter only when the input changes from ON to OFF.
-''IbounceOff(pin, ms)'' | Pin number, stable time (ms) | Filtered state | Delays only the ONOFF transition|+
  
-<code cpp> +[[:en-us_commands:builtin|← Built-in function list]]
-void loop() { +
-  bool button = Ibounce(0, 30); +
-  digitalWrite(64, button); +
-+
-</code> +
- +
-===== Command Prototypes ===== +
- +
-^ Return Type ^ Command Prototype ^ +
-| ''bool'' | ''Ibounce(uint8_t pin, uint32_t debounceTime)''+
-| ''bool'' | ''IbounceOn(uint8_t pin, uint32_t debounceTime)''+
-| ''bool'' | ''IbounceOff(uint8_t pin, uint32_t debounceTime)''+
-| ''bool'' | ''IdigitalRead(uint8_t pin, uint8_t samples)''+
- +
-The ''Ibounce'' functions retain state, so keep calling them in ''loop()''. Specify the actual pin or logical channel for your product. +
- +
-[[:en-us_commands:builtin|← Built-in Command List]]+
  
en-us_commands/digital_filter.1788785565.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki