mosh:element_library:button
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| mosh:element_library:button [2025/06/27 14:15] – [Parameter Table:] mosh | mosh:element_library:button [2025/06/30 15:38] (current) – [Runtime Methods:] mosh | ||
|---|---|---|---|
| Line 62: | Line 62: | ||
| Methods intended to be called during setup or initialization. These configure how the element behaves and are typically not changed during runtime. | Methods intended to be called during setup or initialization. These configure how the element behaves and are typically not changed during runtime. | ||
| - | |**Method**|**Direction**|**Required**|**Parameters**|**Description**| | + | |**Method**|**Direction**|**Required**|**Default**|**Parameters**|**Description**| |
| - | |setActiveLow(bool)|Write|❌|bool|Button is pressed when pulled low| | + | |setActiveLow(bool)|Write|❌|true|bool|Button is pressed when pulled low| |
| - | |setDebounce(uint16_t)|Write|❌|uint16_t|Set the debounce time in milliseconds| | + | |setDebounce(uint16_t)|Write|❌|10|uint16_t|Set the debounce time in milliseconds| |
| - | |setLongPressDelay(uint16_t)|Write|❌|uint16_t|Set the long-press delay in milliseconds| | + | |setLongPressDelay(uint16_t)|Write|❌|750|uint16_t|Set the long-press delay in milliseconds| |
| - | |setName(string)|Write|❌|string|Set a friendly name for the element| | + | |setName(string)|Write|❌|//null//|string|Set a friendly name for the element| |
| - | |setPin(uint8_t)|Write|✅|uint8_t|The pin the button is wired to| | + | |setPin(uint8_t)|Write|✅|//null//|uint8_t|The pin the button is wired to| |
| - | |setPressDelay(uint16_t)|Write|❌|uint16_t|Set the press delay in milliseconds| | + | |setPressDelay(uint16_t)|Write|❌|250|uint16_t|Set the press delay in milliseconds| |
| - | |setPullup(bool)|Write|❌|bool|Use the internal pullup| | + | |setPullup(bool)|Write|❌|true|bool|Use the internal pullup| |
| + | |setStreamOnPress(bool)|Write|❌|false|bool|Button will send stream of PRESS events while active| | ||
| + | |setStreamOnPressFreq(uint16_t)|Write|❌|// | ||
| ====Runtime Methods: ==== | ====Runtime Methods: ==== | ||
| Line 76: | Line 77: | ||
| |buttonIsPressed()|Read|--|bool|Returns true if button is pressed, false if not| | |buttonIsPressed()|Read|--|bool|Returns true if button is pressed, false if not| | ||
| |getFriendlyName()|Read|--|string|Returns the friendly name of the element| | |getFriendlyName()|Read|--|string|Returns the friendly name of the element| | ||
| - | |getLastPropertyChange()|Read|--|uint32_t|get the amount of time (in millis) since the last state change)| | + | |getLastPropertyChange()|Read|--|uint32_t|get the amount of time (in millies) since the last state change)| |
| |getProperty(name)|Read|friendlyName, | |getProperty(name)|Read|friendlyName, | ||
| |getID()|Read|--|uint8_t|Returns the element' | |getID()|Read|--|uint8_t|Returns the element' | ||
/var/www/wiki.moshnetworks.com/data/attic/mosh/element_library/button.1751033740.txt.gz · Last modified: by mosh
