Reference.EsploraReadButton History

Show minor edits - Show changes to markup

December 24, 2012, at 07:28 PM by Scott Fitzgerald -
Changed lines 17-27 from:
to:
SWITCH_1 or SWITCH_DOWN
SWITCH_2 or SWITCH_LEFT
SWITCH_3 or SWITCH_UP
SWITCH_4 or SWITCH_RIGHT
 
JOYSTICK_DOWN = JOYSTICK_BASE
JOYSTICK_LEFT = JOYSTICK_BASE+1
JOYSTICK_UP = JOYSTICK_BASE+2
JOYSTICK_RIGHT = JOYSTICK_BASE+3
Changed line 54 from:
to:
December 24, 2012, at 04:38 AM by Tom Igoe -
Changed lines 30-31 from:

HIGH when pressed, LOW when not pressed.

to:

LOW when pressed, HIGH when not pressed.

Changed line 43 from:

if(button == HIGH)

to:

if(button == LOW)

December 07, 2012, at 11:03 PM by Scott Fitzgerald -
Changed lines 11-12 from:

readButton(button)

to:

Esplora.readButton(button)

Deleted line 54:
December 04, 2012, at 08:23 PM by Scott Fitzgerald -
Changed lines 7-8 from:

Read the button state and returns if it is HIGH or LOW. Passing the parameter associated to the button will give the state of the button.

to:

Reads a button's state and returns if it is HIGH or LOW.

Changed lines 11-12 from:

readButton(channel)

to:

readButton(button)

Changed lines 15-16 from:

channel: the associated button that you wanto read. Valid argument are:

to:

button: the associated button that you wanto read. Valid argument are:

Changed lines 30-31 from:

return the state of the interrogated button. It could be HIGH or LOW.

to:

HIGH when pressed, LOW when not pressed.

Changed line 34 from:

[@

to:
Changed lines 51-52 from:

@]

to:
December 03, 2012, at 04:24 PM by Federico -
Added lines 1-55:

Esplora

readButton()

Description

Read the button state and returns if it is HIGH or LOW. Passing the parameter associated to the button will give the state of the button.

Syntax

readButton(channel)

Parameters

channel: the associated button that you wanto read. Valid argument are:

Returns

return the state of the interrogated button. It could be HIGH or LOW.

Example

#include <Esplora.h>

void setup(){} 

void loop()
{
int button = Esplora.readButton(SWITCH_DOWN);

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

See also

readJoystickSwitch()

Share