added gy80 dcm
Dependencies: mbed DCM_AHRS_GY80 PID MMA8451Q
Fork of quadCommand by
Diff: quadCommand/quadCommand.h
- Revision:
- 49:f202fb0d4128
- Parent:
- 48:75d06c707414
- Child:
- 50:197a18e49eb4
--- a/quadCommand/quadCommand.h Mon Jun 10 02:18:56 2013 +0000 +++ b/quadCommand/quadCommand.h Mon Jun 10 04:43:30 2013 +0000 @@ -29,22 +29,22 @@ const PinName ACCSDA = PTE25; // Pin for accelerometer SDA line. const PinName ACCSCL = PTE24; // Pin for accelerometer SCL line. -const float SENSSORDELAY = .2; +#define SENSSORDELAY 10.0f +#define SENDDELAY 10.0f // PID constants. -#define DEFAULT_WINDUP_GUARD 20.0f +#define DEFAULT_WINDUP_GUARD 20.0f +#define MOTOR_UPDATE 10.0f class quadCommand { public: quadCommand(); // Constructor. - void run(); // Loop. - void rxInput(); // Deal with new input from xbee. - void updateMotors(); - void updateCurrent(); - void sendTelemetry(); - - static const float MOTOR_UPDATE; + void run(); // The main loop. + void rxInput(); // Receive data from the Xbee. + void updateMotors(); // Send PID values to the motors. + void updateCurrent(); // Update the current telemetry. + void sendTelemetry(); // Transmit the current telemetry. private: motor *myMotors[4]; // Array of motor objects. @@ -52,6 +52,8 @@ sensors *world; // Sensors used to observe the world. Ticker sensorProcess; + Ticker sendProcess; + Ticker motorProcess; // Control timer float currentThrottle; float currentPitch;