Block:Debounced Switch
Digital input is commonly used to detect the state of switches and buttons. This block also includes the debouncing (See also: Block:Debounce) of the switch or button.
Example
- the switch has the 'name': 'sw1'
- and connected to 'port' 'D11' (or any other port you chose)
- use the current value of 'sw1' in a rule, for example
- set a LED on when sw1 is on: "if ( sw1 ) { led1 = 1 ; } else { led1 = 0 ;}"
Infocard
Hardware switch to ground, with cpu internal pull-up. Software debounced. (1=switch pressed).
Property | Description |
---|---|
Disabled | To disable or enable this block. |
Name | The name of this block. |
Invert | Invert the output |
Pin | Pin number. |
Comment | To optionally enter a comment. It does not impact the generated firmware. |