Arduino Function: Esplora.readJoystickButton

Description

This function reads the joystick's button and returns if its state is LOW or HIGH. This function does basically the same thing as readJoystickSwitch(), but it returns values consistent with the readButton() function.

Syntax

Esplora.readJoystickButton()

Returns

 LOW when pressed HIGH when not pressed.

Examples

#include <Esplora.h>


void setup(){
// nothing in setup
}

void loop()
{
int button = Esplora.readJoystickButton();

if(button == LOW)
{
Esplora.writeRed(255);
}
else {
Esplora.writeRed(0);
}
}


Based on the reference originally written by Arduino Community,  wiring.org.co and  arduino.cc