Joystick12 Class
- ID: joystick12
- Name: 2-axis Analog Joystick
- Category: ainput
- Manufacturer: generic
- Connection: analog
- Kit: robok
This module defines the Joystick API, and implementation for the X and Y buttons could be treated as normal GPIO - this enables easier interrupt support. This driver should be compatible with any 2-axis analog joystick.
Item Index
Methods
Methods
Joystick12
(
Number
-
pinX
-
pinY
Instantiates a Joystick object
Parameters:
-
pinX
NumberAnalog pin where the X input is connected
-
pinY
NumberAnalog pin where the Y input is connected
Returns:
Number:
getXInput
()
Number
Gets the X input
Returns:
Number:
float X value, ranging from -1 to 1; 0 is mid
getYInput
()
Number
Gets the Y input
Returns:
Number:
float Y value, ranging from -1 to 1; 0 is mid