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 PID MMA8451Q
Diff: quadCommand/quadCommand.h
- Revision:
- 0:8681037b9a18
- Child:
- 1:9b90e7de6e09
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/quadCommand/quadCommand.h Sun Jun 09 22:13:59 2013 +0000
@@ -0,0 +1,52 @@
+/************************* quadCommand.h *********************************/
+/* */
+/*************************************************************************/
+
+#ifndef QUAD_COMMAND_H
+#define QUAD_COMMAND_H
+
+#include "mbed.h"
+#include "motor.h"
+#include "com.h"
+#include "sensors.h"
+
+const PinName MOTOR1 = PTD4; // Pin used for motor 1.
+const PinName MOTOR2 = PTA12; // Pin used for motor 2.
+const PinName MOTOR3 = PTA4; // Pin used for motor 3.
+const PinName MOTOR4 = PTA5; // Pin used for motor 4.
+
+const PinName TXPIN = PTD3; // Pin used for xbee TX.
+const PinName RXPIN = PTD2; // Pin used for xbee RX.
+
+class quadCommand
+{
+ public:
+ quadCommand(); // Constructor.
+ void run(); // Loop.
+ void rxInput(); // Deal with new input from xbee.
+ void updatePosition();
+ void txPosition();
+
+ private:
+ motor *myMotors[4]; // Array of motor objects.
+ com *myCom; // The com object.
+ sensors *world; // Sensors used to observe the world.
+
+ short rxThrottle; // Throttle position: 0 -> 100.
+ short rxPitch; // Pitch: -180 -> 180.
+ short rxRoll; // Roll: -180 -> 180.
+ short rxYaw; // Yaw: -180 -> 180.
+
+ bool globalUpdate;
+
+ short currentPitch; //
+ bool updatedPitch;
+
+ short currentRoll; //
+ bool updatedRoll;
+
+ short currentAlt; //
+ bool updatedAlt;
+};
+
+#endif
\ No newline at end of file
