Analog Joystick Library

Fork of SparkfunAnalogJoystick by ECE4180

Embed: (wiki syntax)

« Back to documentation index

SparkfunAnalogJoystick Class Reference

SparkfunAnalogJoystick Class Reference

Joystick class. More...

#include <SparkfunAnalogJoystick.h>

Public Member Functions

 SparkfunAnalogJoystick (PinName, PinName, PinName)
 Constructor of Joystick object.
int button ()
 Get the button status.
float xAxis ()
 X axis value, reverse the value to get the x value in a normal Cartesian coordinate system.
float yAxis ()
 Y axis value.
float angle ()
 Calculate the angle value in a polar coordinate system.
float distance ()
 Calculate the normalized distance value in a polar coordinate system.

Detailed Description

Joystick class.

User Interface to use Sparkfun Joystick Module

Definition at line 15 of file SparkfunAnalogJoystick.h.


Constructor & Destructor Documentation

SparkfunAnalogJoystick ( PinName  vert,
PinName  horz,
PinName  sel 
)

Constructor of Joystick object.

Definition at line 14 of file SparkfunAnalogJoystick.cpp.


Member Function Documentation

float angle (  )

Calculate the angle value in a polar coordinate system.

Definition at line 35 of file SparkfunAnalogJoystick.cpp.

int button (  )

Get the button status.

Definition at line 20 of file SparkfunAnalogJoystick.cpp.

float distance (  )

Calculate the normalized distance value in a polar coordinate system.

Definition at line 50 of file SparkfunAnalogJoystick.cpp.

float xAxis (  )

X axis value, reverse the value to get the x value in a normal Cartesian coordinate system.

Definition at line 25 of file SparkfunAnalogJoystick.cpp.

float yAxis (  )

Y axis value.

Definition at line 30 of file SparkfunAnalogJoystick.cpp.