Documentation / Blocks / Hardware Switch

Hardware Switch

To read a switch

De-bounce functionality is already built-in this block.

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 ;}”


Reference

Setting Description
Disabled To disable or enable this block.
Name The name of this block.
Pin Pin number; specify as: D.
For example: D12
Comment To optionally enter a comment.
It does not impact the generated firmware.