upm  0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
Public Member Functions

API for the ElecFreaks* Joystick v 1.2-1.4 Breakout. More...

Detailed Description

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.

joystick12.jpg

Public Member Functions

 Joystick12 (int pinX, int pinY)
 
 ~Joystick12 ()
 
float getXInput ()
 
float getYInput ()
 

Constructor & Destructor Documentation

Joystick12 ( int  pinX,
int  pinY 
)

Instantiates a Joystick object

Parameters
pinXAnalog pin where the X input is connected
pinYAnalog pin where the Y input is connected
~Joystick12 ( )

Joystick object destructor

Member Function Documentation

float getXInput ( )

Gets the X input

Returns
float X value, ranging from -1 to 1; 0 is mid
float getYInput ( )

Gets the Y input

Returns
float Y value, ranging from -1 to 1; 0 is mid

The documentation for this class was generated from the following files: