Reference.EsploraReadJoystickButton History

Hide minor edits - Show changes to output

December 24, 2012, at 05:10 AM by Tom Igoe -
Changed lines 7-8 from:
Reads the joystick's button and returns if its state is LOW or HIGH.
to:
Reads the joystick's button and returns if its state is LOW or HIGH. This function does basically the same thing as [[Reference/EsploraReadJoystickSwitch | readJoystickSwitch]](), but it returns values consistent with the [[Reference/EsploraReadButton | readButton]]() function.
December 24, 2012, at 05:07 AM by Tom Igoe -
Added lines 1-43:
[[EsploraLibrary | Esplora]]

!!readJoystickButton()

!!!!Description

Reads the joystick's button and returns if its state is LOW or HIGH.

!!!!Syntax

Esplora.readJoystickButton()

!!!!Parameters

none

!!!!Returns

LOW when pressed, HIGH when not pressed.

!!!!Example

(:source lang=arduino tabwidth=4:)
#include <Esplora.h>


void setup(){
// nothing in setup
}

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

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

Share