added gy80 dcm

Dependencies:   mbed DCM_AHRS_GY80 PID MMA8451Q

Fork of quadCommand by Greg Abdo

Committer:
gabdo
Date:
Sun Jun 09 22:33:11 2013 +0000
Revision:
1:9b90e7de6e09
Parent:
0:8681037b9a18
Child:
6:21ae5e53bb5f
Updated quadCommand vars
;

Who changed what in which revision?

UserRevisionLine numberNew 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 #ifndef QUAD_COMMAND_H
gabdo 0:8681037b9a18 6 #define QUAD_COMMAND_H
gabdo 0:8681037b9a18 7
gabdo 0:8681037b9a18 8 #include "mbed.h"
gabdo 0:8681037b9a18 9 #include "motor.h"
gabdo 0:8681037b9a18 10 #include "com.h"
gabdo 0:8681037b9a18 11 #include "sensors.h"
gabdo 0:8681037b9a18 12
gabdo 0:8681037b9a18 13 const PinName MOTOR1 = PTD4; // Pin used for motor 1.
gabdo 0:8681037b9a18 14 const PinName MOTOR2 = PTA12; // Pin used for motor 2.
gabdo 0:8681037b9a18 15 const PinName MOTOR3 = PTA4; // Pin used for motor 3.
gabdo 0:8681037b9a18 16 const PinName MOTOR4 = PTA5; // Pin used for motor 4.
gabdo 0:8681037b9a18 17
gabdo 0:8681037b9a18 18 const PinName TXPIN = PTD3; // Pin used for xbee TX.
gabdo 0:8681037b9a18 19 const PinName RXPIN = PTD2; // Pin used for xbee RX.
gabdo 0:8681037b9a18 20
gabdo 0:8681037b9a18 21 class quadCommand
gabdo 0:8681037b9a18 22 {
gabdo 0:8681037b9a18 23 public:
gabdo 0:8681037b9a18 24 quadCommand(); // Constructor.
gabdo 0:8681037b9a18 25 void run(); // Loop.
gabdo 0:8681037b9a18 26 void rxInput(); // Deal with new input from xbee.
gabdo 0:8681037b9a18 27 void updatePosition();
gabdo 0:8681037b9a18 28 void txPosition();
gabdo 0:8681037b9a18 29
gabdo 0:8681037b9a18 30 private:
gabdo 0:8681037b9a18 31 motor *myMotors[4]; // Array of motor objects.
gabdo 0:8681037b9a18 32 com *myCom; // The com object.
gabdo 0:8681037b9a18 33 sensors *world; // Sensors used to observe the world.
gabdo 0:8681037b9a18 34
gabdo 1:9b90e7de6e09 35 float currentThrottle;
gabdo 1:9b90e7de6e09 36 float currentPitch;
gabdo 1:9b90e7de6e09 37 float currentRoll;
gabdo 1:9b90e7de6e09 38 float currentYaw;
gabdo 0:8681037b9a18 39
gabdo 1:9b90e7de6e09 40 float targetThrottle;
gabdo 1:9b90e7de6e09 41 float targetPitch;
gabdo 1:9b90e7de6e09 42 float targetRoll;
gabdo 1:9b90e7de6e09 43 float targetYaw;
gabdo 0:8681037b9a18 44 };
gabdo 0:8681037b9a18 45
gabdo 0:8681037b9a18 46 #endif