Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed DCM_AHRS_GY80 PID MMA8451Q
Fork of quadCommand by
quadCommand/sensorS/sensors.h@1:9b90e7de6e09, 2013-06-09 (annotated)
- Committer:
- gabdo
- Date:
- Sun Jun 09 22:33:11 2013 +0000
- Revision:
- 1:9b90e7de6e09
- Parent:
- 0:8681037b9a18
- Child:
- 4:ce6ad16337c5
Updated quadCommand vars
;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| gabdo | 0:8681037b9a18 | 1 | /************************* quadCommand.h *********************************/ |
| gabdo | 0:8681037b9a18 | 2 | /* */ |
| gabdo | 0:8681037b9a18 | 3 | /*************************************************************************/ |
| gabdo | 0:8681037b9a18 | 4 | |
| gabdo | 0:8681037b9a18 | 5 | #include "MMA8451Q.h" |
| gabdo | 0:8681037b9a18 | 6 | |
| gabdo | 0:8681037b9a18 | 7 | #ifndef SENSORS_H |
| gabdo | 0:8681037b9a18 | 8 | #define SENSORS_H |
| gabdo | 0:8681037b9a18 | 9 | |
| gabdo | 0:8681037b9a18 | 10 | #define MMA8451_I2C_ADDRESS (0x1d<<1) |
| gabdo | 0:8681037b9a18 | 11 | const PinName ACCSDA = PTE25; |
| gabdo | 0:8681037b9a18 | 12 | const PinName ACCSCL = PTE24; |
| gabdo | 0:8681037b9a18 | 13 | |
| gabdo | 0:8681037b9a18 | 14 | class sensors |
| gabdo | 0:8681037b9a18 | 15 | { |
| gabdo | 0:8681037b9a18 | 16 | public: |
| gabdo | 0:8681037b9a18 | 17 | sensors(); |
| gabdo | 0:8681037b9a18 | 18 | short getAbsoluteX(); |
| gabdo | 0:8681037b9a18 | 19 | short getAbsoluteY(); |
| gabdo | 0:8681037b9a18 | 20 | |
| gabdo | 0:8681037b9a18 | 21 | private: |
| gabdo | 0:8681037b9a18 | 22 | MMA8451Q *acc; |
| gabdo | 1:9b90e7de6e09 | 23 | |
| gabdo | 1:9b90e7de6e09 | 24 | short rxThrottle; // Throttle position: 0 -> 100. |
| gabdo | 1:9b90e7de6e09 | 25 | short rxPitch; // Pitch: -180 -> 180. |
| gabdo | 1:9b90e7de6e09 | 26 | short rxRoll; // Roll: -180 -> 180. |
| gabdo | 1:9b90e7de6e09 | 27 | short rxYaw; // Yaw: -180 -> 180. |
| gabdo | 1:9b90e7de6e09 | 28 | |
| gabdo | 1:9b90e7de6e09 | 29 | bool globalUpdate; |
| gabdo | 1:9b90e7de6e09 | 30 | |
| gabdo | 1:9b90e7de6e09 | 31 | short currentPitch; // |
| gabdo | 1:9b90e7de6e09 | 32 | bool updatedPitch; |
| gabdo | 1:9b90e7de6e09 | 33 | |
| gabdo | 1:9b90e7de6e09 | 34 | short currentRoll; // |
| gabdo | 1:9b90e7de6e09 | 35 | bool updatedRoll; |
| gabdo | 1:9b90e7de6e09 | 36 | |
| gabdo | 1:9b90e7de6e09 | 37 | short currentAlt; // |
| gabdo | 1:9b90e7de6e09 | 38 | bool updatedAlt; |
| gabdo | 0:8681037b9a18 | 39 | }; |
| gabdo | 0:8681037b9a18 | 40 | #endif |
