Arduino Toggle Button Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld
Arduino Toggle Button Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld

Use your smartphone touch screen as an on or off button. Just two simple words can fit in your code so you can control things by checking the state of toggle button on your smartphone.

This shield is one of the I/O shields. I/O shields provides simple function of using your smartphone as input or output to Arduino.Learn more from the I/O shields tutorial.

ToggleButton library converts & simulates the smartphone as a real Hardware toggle button so that you can control physical objects surrounding you.

Adding #define CUSTOM_SETTINGS along with #define INCLUDE_TOGGLE_BUTTON_SHIELD is a key that will let you unlock the Toggle Button shield only amongst all shields and prevent 1Sheeld library from eating your memory specially for UNO board.

bool getStatus(void)

Checks if the button is pressed or not.

 

SYNTAX
ToggleButton.getStatus( );

 

RETURNS
Returns a yes “1” or no “0”.

 

PARAMETERS
None.

 

USAGE
bool value = ToggleButton.getStatus();

 

void setOnButtonStatusChange(void(*userFunction)(bool))

Sets a certain individual function written by the user in the sketch to be called and runs its functionality each time the toggle button is pressed.

 

SYNTAX
ToggleButton.setOnButtonStatusChange(&userFunctionName);

 

RETURNS
None.

 

PARAMETERS
&userFunctionName: takes the physical address of the userFunction in the memory and jump to it once called to execute it’s functionality.

 

USAGE
ToggleButton.setOnButtonStatusChange(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked each time a the button is pressed. */
void myFunction (bool isButtonPressed)
{
    /*Turn on a LED if button pressed. */
    if(isButtonPressed)
    {
      digitalWrite(pin13,HIGH);
    }
    else
    {
      digitalWrite(pin13,LOW);
    }
}