Dependencies:   USBDevice mbed-rtos mbed

Fork of JoyStick by Ries Twisk

This is a simple Joystick HID that I use for xplane and a home build yoke + paddels, see this forum with the look and feel of it : http://forums.x-plane.org/index.php?showtopic=70041

The analog input are filtered with a LowPass IIR filter and the digital input's will be derived from the analog input and de-bounced.

The analog values are read at a 1Khz interval and to ensure we don't push the USB stack to much at a maximum rate of 20 updates/sec HID data is send over USB only if any values where changed. The JoyStick will send 16Bit analog values as opposite of 8 bit values that are normally used to increase accuracy of the whole system. This is well noticeable within x-plane!

The JoyStick uses the JoyStick copied from Wim Huiskamp and modified to suite my needs and the MBED RTOS libraries for reading analog inputs, sending debug data over USB and sending HID data, 3 threads in total.

Committer:
rvt
Date:
Wed Aug 28 13:12:39 2013 +0000
Revision:
1:5b2ab44eb31f
Parent:
0:33bc88c4ab31
Child:
5:a0bb17c379ce
Code cleanup

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rvt 0:33bc88c4ab31 1 #ifndef ANALOGFILTERINTERFACE_H
rvt 0:33bc88c4ab31 2 #define ANALOGFILTERINTERFACE_H
rvt 0:33bc88c4ab31 3
rvt 1:5b2ab44eb31f 4 /**
rvt 1:5b2ab44eb31f 5 Analog filter Interface
rvt 1:5b2ab44eb31f 6 This is the base class if you want to create your own filters and beable to chain them within analog inputs.
rvt 1:5b2ab44eb31f 7 */
rvt 0:33bc88c4ab31 8 class AnalogFilterInterface
rvt 0:33bc88c4ab31 9 {
rvt 0:33bc88c4ab31 10 private:
rvt 0:33bc88c4ab31 11 AnalogFilterInterface *_chain;
rvt 0:33bc88c4ab31 12 long _data;
rvt 0:33bc88c4ab31 13 public:
rvt 0:33bc88c4ab31 14 AnalogFilterInterface(AnalogFilterInterface *chain);
rvt 0:33bc88c4ab31 15 AnalogFilterInterface();
rvt 1:5b2ab44eb31f 16
rvt 1:5b2ab44eb31f 17 // Set a datapoint
rvt 0:33bc88c4ab31 18 virtual void setData(long data);
rvt 1:5b2ab44eb31f 19
rvt 1:5b2ab44eb31f 20 // Get the filtered datapoint
rvt 0:33bc88c4ab31 21 virtual long getData();
rvt 1:5b2ab44eb31f 22
rvt 1:5b2ab44eb31f 23 // Get the chained filter
rvt 0:33bc88c4ab31 24 virtual AnalogFilterInterface * getChain(){return _chain;};
rvt 0:33bc88c4ab31 25 };
rvt 0:33bc88c4ab31 26
rvt 0:33bc88c4ab31 27 #endif
rvt 0:33bc88c4ab31 28
rvt 0:33bc88c4ab31 29
rvt 0:33bc88c4ab31 30