Button

Data

DataTypeValues
Button stateunsigned char0 - button not pressed
1 - button pressed

Button copies the physical push button and transmits information to the microcontroller about its pressed. Touching the button, it is pressed, when released the button returns to its not pressed.

Settings

Settings of buttons allow to set the different values:

  • Variable name - name of the button and the variable in the source code for the microcontroller, allow to set a name for the variable of C rules.
  • Caption on button - set the caption on the button. By default, it's a big letter "X". Allowed to ask in any language.
  • PIN connected - You can specify what pin of controller connect this button, or no connect it. If button is connected to pin, this will generate additional code to control the output of the microcontroller by this button.

Code example

A common example shows how to check the current status of the button is pressed or not:


  if (RemoteXY.button_1!=0) {
    /*  button pressed */
  }
  else {
    /*  button not pressed */
  }

The following example shows how you can control output pin of the microcontroller with the number PIN_BUTTON using control - button.

Code for Arduino IDE:


  if (RemoteXY.button_1!=0) digitalWrite(PIN_BUTTON, HIGH);
  else digitalWrite(PIN_BUTTON, LOW);