Arduino Gamepad Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld
Arduino Gamepad Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld

Use your smartphone touch screen as a game pad. This shield allows you to control things with your smart phone
like robotics, hackable quad-copters …etc.

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.

Gamepad Library converts your smartphone to a gamepad so that you can control any physical objects as motors, lights or even more attached to your Arduino board.

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

bool isUpPressed(void)

Check if the up button is pressed in the application and sends an acknowledgement to Arduino if pressed.

 

SYNTAX
GamePad.isUpPressed();

 

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

 

PARAMETERS
None.

 

USAGE
GamePad.isUpPressed();

 

bool isDownPressed(void)

Check if the down button is pressed in the application and sends an acknowledgement to Arduino if pressed.

 

SYNTAX
GamePad.isDownPressed();

 

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

 

PARAMETERS
None.

 

USAGE
GamePad.isDownPressed();

 

bool isLeftPressed(void)

Check if the left button is pressed in the application and sends an acknowledgement to Arduino if pressed.

 

SYNTAX
GamePad.isLeftPressed();

 

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

 

PARAMETERS
None.

 

USAGE
GamePad.isLeftPressed();

 

bool isRightPressed(void)

Check if the right button is pressed in the application and sends an acknowledgement to Arduino if pressed.

 

SYNTAX
GamePad.isRightPressed();

 

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

 

PARAMETERS
None.

 

USAGE
GamePad.isRightPressed();

 

bool isOrangePressed(void)

Check if the orange button is pressed in the application and sends an acknowledgement to Arduino if pressed.

 

SYNTAX
GamePad.isOrangePressed();

 

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

 

PARAMETERS
None.

 

USAGE
GamePad.isOrangePressed();

 

bool isRedPressed(void)

Check if the red button is pressed in the application and sends an acknowledgement to Arduino if pressed.

 

SYNTAX
GamePad.isRedPressed();

 

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

 

PARAMETERS
None.

 

USAGE
GamePad.isRedPressed();

 

bool isGreenPressed(void)

Check if the green button is pressed in the application and sends an acknowledgement to Arduino if pressed.

 

SYNTAX
GamePad.isGreenPressed();

 

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

 

PARAMETERS
None.

 

USAGE
GamePad.isGreenPressed();

 

bool isBluePressed(void)

Check if the blue button is pressed in the application and sends an acknowledgement to Arduino if pressed.

 

SYNTAX
GamePad.isBluePressed();

 

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

 

PARAMETERS
None.

 

USAGE
GamePad.isBluePressed();

 

void setOnButtonChange(void(*userFunction)(unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char,unsigned char))

Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a button is pressed on gamepad in the application then sends an acknowledgement to Arduino.

 

SYNTAX
GamePad.setOnButtonChange(&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
GamePad.setOnButtonChange(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked each time a new button of the gamepad is pressed. */

void myFunction (unsigned char upButton , unsigned char downButton ,unsigned char leftButton, unsigned char rightButton ,unsigned char orangeButton ,unsigned char redButton,unsigned char greenButon ,unsigned char blueButton)
{
     /* Turn on the led once any button is pressed*/
     if(upButton)
      {
         pinMode(pin13 ,OUTPUT);
         digitalWrite(pin13 ,HIGH);
      }
}