Library for Sparkfun analog joystick

Fork of SparkfunAnalogJoystick by ECE4180

SparkfunAnalogJoystick.h

Committer:
Mpmart08
Date:
2016-04-26
Revision:
4:98f381ce9b3a
Parent:
3:2b40241a7675

File content as of revision 4:98f381ce9b3a:

/** Analog Joystick APIs
 *  Used as a user interface for Sparkfun Analog Joystick Module
 *  @file SparkfunAnalogJoystick.h
 *  @author Yuan,ZHANG; Jiajie,YANG
 */

#ifndef SPARKFUN_ANALOG_JOYSTICK
#define SPARKFUN_ANALOG_JOYSTICK

#include "mbed.h"
#include "PinDetect.h"

/** Joystick class.
 *  User Interface to use Sparkfun Joystick Module
 */
class SparkfunAnalogJoystick
{
	
public:
	// Constructor of Joystick object
	SparkfunAnalogJoystick(PinName, PinName, PinName);
	// Get the button status, 1 for on and 0 for off
	int button();
	// X axis value
	float xAxis();
	// Y axis value
	float yAxis();
	// Angle value in polar coordinates
	float angle();
	// Distance value in polar coordinates
	float distance();
	// select callback function
	//void set_callback(void (*select_hit_callback)(void));
	
protected:
    AnalogIn VERT;
    AnalogIn HORZ;
    //PinDetect SEL;
    DigitalIn SEL;

};

#endif