Arduino Universal Inputs
A collection of libraries for managing/processing input devices on Arduino.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Protected Member Functions | List of all members
ArduinoJoystick Class Reference

Represents a joystick attached to an Arduino ADC pin. More...

#include <ArduinoJoystick.h>

Inheritance diagram for ArduinoJoystick:
Inheritance graph
[legend]
Collaboration diagram for ArduinoJoystick:
Collaboration graph
[legend]

Public Member Functions

 ArduinoJoystick (inputid_t id, inputpin_t adc)
 Creates a new joystick on an Arduino ADC. More...
 
- Public Member Functions inherited from IJoystick
 IJoystick (inputid_t id)
 Creates a new joystick. More...
 
inputtype_t type () const
 Retrieves the type of this device. More...
 
bool poll ()
 Polls this input device for change. More...
 
inputanalog_t getRawValue () const
 Gets last read raw value. More...
 
inputanalog_t getCentredValue () const
 Gets the value centered at zero at the centre point and clamped if within the deadbands. More...
 
inputanalog_t getValue () const
 Gets the transformed value. More...
 
void setTransformation (IValueTransform *transform)
 Sets the transformation to use between the centred value and outout value. More...
 
bool setThreshold (inputanalog_t threshold)
 Sets the minimum change in raw value that will fire an event. More...
 
inputanalog_t getThreshold () const
 Returns the threshold value. More...
 
bool setPoints (inputanalog_t low, inputanalog_t centre, inputanalog_t high)
 Sets the low, centre and high points. More...
 
bool setPoints (inputanalog_t low, inputanalog_t high)
 Sets the low and high end points. More...
 
bool setDeadbands (inputanalog_t low, inputanalog_t centre, inputanalog_t high)
 Sets the low, centre and high deadband widths. More...
 
bool setDeadbands (inputanalog_t low, inputanalog_t high)
 Sets the low and high deadband widths. More...
 
inputanalog_t getLowPoint () const
 Gets the low end point raw value. More...
 
inputanalog_t getCentrePoint () const
 Gets the centre point raw value. More...
 
inputanalog_t getHighPoint () const
 Gets the high end point raw value. More...
 
inputanalog_t getLowDeadband () const
 Gets the deadband width at the low end point. More...
 
inputanalog_t getCentreDeadband () const
 Gets the deadband width at the centre point. More...
 
inputanalog_t getHighDeadband () const
 Gets the deadband width at the high end point. More...
 
- Public Member Functions inherited from IInputDevice
 IInputDevice (inputid_t id)
 Creates a new input device. More...
 
inputid_t getID () const
 Retrieves the ID of this device. More...
 

Protected Member Functions

inputanalog_t getPhysicalValue () const
 Gets the raw value form the joystick. More...
 

Detailed Description

Represents a joystick attached to an Arduino ADC pin.

Constructor & Destructor Documentation

ArduinoJoystick::ArduinoJoystick ( inputid_t  id,
inputpin_t  adc 
)

Creates a new joystick on an Arduino ADC.

Parameters
idID of the joystick
adcADC pin joystick is attached to

Member Function Documentation

inputanalog_t ArduinoJoystick::getPhysicalValue ( ) const
protectedvirtual

Gets the raw value form the joystick.

Returns
Raw value

Implements IJoystick.


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