Push Button Shield acts as Arduino Shield via 1Sheeld

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

Buy 1Sheeld

Use your smartphone screen as a virtual push button to make it easier to test your ideas that uses a real push button.

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.

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

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

bool isPressed(void)

Checks if the button is pressed or not.

SYNTAX

PushButton.isPressed( );

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

PARAMETERS
None.

USAGE
bool value = PushButton.isPressed();

 

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 push button is pressed.

SYNTAX
PushButton.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
PushButton.setOnButtonStatusChange(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked each time a the button is pressed. */
void myFunction (byte isButtonPressed)
{
    /*Turn on a LED if button pressed. */
    if(isButtonPressed)
    {
      digitalWrite(pin13,HIGH);
    }
    else
    {
      digitalWrite(pin13,LOW);
    }
}