Reference.EsploraReadJoystickSwitch History

Hide minor edits - Show changes to markup

December 24, 2012, at 05:13 AM by Tom Igoe -
Changed lines 7-8 from:

Reads the joystick's button and returns if its state is 0 or 1023.

to:

Reads the joystick's button and returns if its state is 0 or 1023. If you prefer something more consistent with the readButton() function, you may want to use readJoystickButton() instead. That function does the same as this, but returns LOW when the joystick button is pressed, and HIGH when not pressed.

December 24, 2012, at 04:43 AM by Tom Igoe -
Changed lines 7-8 from:

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

to:

Reads the joystick's button and returns if its state is 0 or 1023.

December 24, 2012, at 04:42 AM by Tom Igoe -
Changed lines 19-20 from:

HIGH when pressed, LOW when not pressed.

to:

0 when pressed, 1023 when not pressed.

Added lines 24-26:
  1. include <Esplora.h>

Changed lines 33-35 from:
  int button = Esplora.readJoystcikSwitch();

  if(button == HIGH)
to:
  int button = Esplora.readJoystickSwitch();

  if(button == 0)
Deleted line 42:
December 07, 2012, at 11:03 PM by Scott Fitzgerald -
Changed lines 11-12 from:

readJoystickSwitch()

to:

Esplora.readJoystickSwitch()

Changed line 41 from:
to:
December 04, 2012, at 08:09 PM by Scott Fitzgerald -
Changed lines 19-20 from:

HIGH if pressed, and LOW if not.

to:

HIGH when pressed, LOW when not pressed.

December 04, 2012, at 07:44 PM by Scott Fitzgerald -
Changed lines 3-4 from:

readJoystcikSwitch()

to:

readJoystickSwitch()

Changed lines 7-8 from:

Read the joystick central button and returns if its stat is HIGH or LOW.

to:

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

Changed lines 11-12 from:

readJoystcikSwitch()

to:

readJoystickSwitch()

Changed lines 19-20 from:

return the state of the joystick central button when the function was called.

to:

HIGH if pressed, and LOW if not.

Changed lines 23-25 from:

[@ void setup(){}

to:
Changed lines 30-32 from:

int button = Esplora.readJoystcikSwitch();

if(button == HIGH)

to:
  int button = Esplora.readJoystcikSwitch();

  if(button == HIGH)
Changed line 36 from:

else {

to:
  else {
Changed lines 40-41 from:

@]

to:
December 03, 2012, at 04:21 PM by Federico -
Added lines 1-38:

Esplora

readJoystcikSwitch()

Description

Read the joystick central button and returns if its stat is HIGH or LOW.

Syntax

readJoystcikSwitch()

Parameters

none

Returns

return the state of the joystick central button when the function was called.

Example

void setup(){} 

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

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

Share