Hide minor edits - Show changes to markup
readJoystickY()
Esplora.readJoystickY()
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.
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.
| 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. |
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.
[@
(:source lang=arduino tabwidth=4:)
@]
(:sourceend:)
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.
readJoystickY()
none
| 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. |
#include <Esplora.h>
void setup()
{
Serial.begin(9600);
}
void loop()
{
int value = Esplora.readJoystickY();
Serial.println(value);
delay(1000);
}