Prosper Van / Mbed 2 deprecated quadCommand2

Dependencies:   mbed DCM_AHRS_GY80 PID MMA8451Q

Fork of quadCommand by Greg Abdo

Files at this revision

API Documentation at this revision

Comitter:
gabdo
Date:
Sun Jun 09 22:33:11 2013 +0000
Parent:
0:8681037b9a18
Child:
3:3448cc00eb85
Child:
4:ce6ad16337c5
Commit message:
Updated quadCommand vars
;

Changed in this revision

quadCommand/quadCommand.cpp Show annotated file Show diff for this revision Revisions of this file
quadCommand/quadCommand.h Show annotated file Show diff for this revision Revisions of this file
quadCommand/sensorS/sensors.cpp Show annotated file Show diff for this revision Revisions of this file
quadCommand/sensorS/sensors.h Show annotated file Show diff for this revision Revisions of this file
--- a/quadCommand/quadCommand.cpp	Sun Jun 09 22:13:59 2013 +0000
+++ b/quadCommand/quadCommand.cpp	Sun Jun 09 22:33:11 2013 +0000
@@ -26,12 +26,13 @@
     {
         if( myCom->isData() )
             rxInput();
-            
-        //myCom->write( 3, world->getAbsoluteY());       
-        updatePosition();
+           
+        myCom->write( 3, world->getAbsoluteY()); 
+        wait( .05);      
+        //updatePosition();
          
-        if( globalUpdate )
-            txPosition();
+       // if( globalUpdate )
+          //  txPosition();
     }
 }
 
--- a/quadCommand/quadCommand.h	Sun Jun 09 22:13:59 2013 +0000
+++ b/quadCommand/quadCommand.h	Sun Jun 09 22:33:11 2013 +0000
@@ -31,22 +31,16 @@
         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;
+        float currentThrottle;
+        float currentPitch;
+        float currentRoll;
+        float currentYaw;
         
-        short currentRoll;      //
-        bool updatedRoll;
-        
-        short currentAlt;       //
-        bool updatedAlt;
+        float targetThrottle;
+        float targetPitch;
+        float targetRoll;
+        float targetYaw;
 };
 
 #endif
\ No newline at end of file
--- a/quadCommand/sensorS/sensors.cpp	Sun Jun 09 22:13:59 2013 +0000
+++ b/quadCommand/sensorS/sensors.cpp	Sun Jun 09 22:33:11 2013 +0000
@@ -11,10 +11,10 @@
 
 short sensors::getAbsoluteX()
 {
-    return (short)(acc->getAccX() * 100);
+    return (short)(acc->getAccX() * 10);
 } 
 
 short sensors::getAbsoluteY()
 {
-    return (short)(acc->getAccY() * 100);
+    return (short)(acc->getAccY() * 10);
 } 
\ No newline at end of file
--- a/quadCommand/sensorS/sensors.h	Sun Jun 09 22:13:59 2013 +0000
+++ b/quadCommand/sensorS/sensors.h	Sun Jun 09 22:33:11 2013 +0000
@@ -20,5 +20,21 @@
     
     private:
         MMA8451Q *acc;
+        
+        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