Reference.EsploraReadButton History

Hide minor edits - Show changes to output

December 24, 2012, at 07:28 PM by Scott Fitzgerald -
Changed lines 17-27 from:
||border=0
||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;
to:
|| border=0
||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:
[[EsploraReadJoystickSwitch | readJoystickSwitch()]]
to:
[[EsploraReadJoystickSwitch | readJoystickSwitch()]]
December 24, 2012, at 04:38 AM by Tom Igoe -
Changed lines 30-31 from:
[[Constants|HIGH]] when pressed, [[Constants|LOW]] when not pressed.
to:
[[Constants|LOW]] when pressed, [[Constants|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:
[[Constants|HIGH]] when pressed, [[Constants|LOW]] when not pressed.
Changed line 34 from:
[@
to:
(:source lang=arduino tabwidth=4:)
Changed lines 51-52 from:
@]
to:
(:sourceend:)
December 03, 2012, at 04:24 PM by Federico -
Added lines 1-55:
[[EsploraLibrary | 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:

||border=0
||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;

!!!!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
[[EsploraReadJoystickSwitch | readJoystickSwitch()]]

Share