Reference.EsploraReadJoystickY History

Hide minor edits - Show changes to markup

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

readJoystickY()

to:

Esplora.readJoystickY()

Changed line 42 from:
to:
December 04, 2012, at 08:26 PM by Scott Fitzgerald -
Changed lines 7-9 from:

Read the value of the Y axis of the Joystick. When the joystick is in the center it return zero, for convention it returns positive values when is moved upwardly and negative values when moved downwards.

to:

Read the position of the Y-axis of the joystick. When the joystick is in the center, it returns zero. Positive values indicate the joystick has moved up and negative values when moved down.

Changed lines 19-24 from:
0:when the Y-axis is in the middle of the joystick stroke.
from 0 to +512:when the joystick is moved upwardly.
from 0 to -512:when the joystick is moved downwards.

to:

int : 0 when the joystick is in the middle of the y-axis; 1 to 512 when the joystick is moved up; -1 to -512 when the joystick is moved down.

Changed line 24 from:

[@

to:
Changed lines 39-40 from:

@]

to:
Changed lines 42-43 from:
to:
December 03, 2012, at 05:01 PM by Federico -
Added lines 1-47:

Esplora

readJoystickY()

Description

Read the value of the Y axis of the Joystick. When the joystick is in the center it return zero, for convention it returns positive values when is moved upwardly and negative values when moved downwards.

Syntax

readJoystickY()

Parameters

none

Returns

0:when the Y-axis is in the middle of the joystick stroke.
from 0 to +512:when the joystick is moved upwardly.
from 0 to -512:when the joystick is moved downwards.

Example

#include <Esplora.h>

void setup()
{
Serial.begin(9600);
} 

void loop()
{
int value = Esplora.readJoystickY();
Serial.println(value);

delay(1000);
} 

See also

readJoystickX()

Share