Reference.EsploraReadJoystickX History

Hide minor edits - Show changes to output

December 07, 2012, at 11:03 PM by Scott Fitzgerald -
Changed lines 11-12 from:
readJoystickX()
to:
Esplora.readJoystickX()
Deleted line 42:
December 04, 2012, at 08:25 PM by Scott Fitzgerald -
Changed lines 7-9 from:
Read the value of the X axis of the Joystick. When the joystick is in the center it return zero, for convention it returns positive values when is moved to right
and negative values when moved to left.
to:
Read the position of the X-axis of the joystick. When the joystick is in the center, it returns zero. Positive values indicate the joystick has moved to the right and negative values when moved to the left.
Changed lines 19-24 from:
||border=0
||0: ||when the X-axis is in the middle of the joystick stroke.
||from 0 to +512: ||when the joystick is moved to the right.
||from 0 to -512: ||when the joystick is moved to the left.

to:
int : 0 when the joystick is in the middle of the x-axis; 1 to 512 when the joystick is moved to the right; -1 to -512 when the joystick is moved to the left.

Changed line 24 from:
[@
to:
(:source lang=arduino tabwidth=4:)
Changed lines 39-40 from:
@]
to:
(:sourceend:)
December 03, 2012, at 04:27 PM by Federico -
Added lines 1-47:
[[EsploraLibrary | Esplora]]

!!readJoystickX()

!!!!Description

Read the value of the X axis of the Joystick. When the joystick is in the center it return zero, for convention it returns positive values when is moved to right
and negative values when moved to left.

!!!!Syntax

readJoystickX()

!!!!Parameters

none

!!!!Returns

||border=0
||0: ||when the X-axis is in the middle of the joystick stroke.
||from 0 to +512: ||when the joystick is moved to the right.
||from 0 to -512: ||when the joystick is moved to the left.


!!!!Example

[@
#include <Esplora.h>

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

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

delay(1000);
}
@]

!!!!See also
[[EsploraReadJoystickY | readJoystickY()]]

Share