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.
Fork of IEEE_14_Freescale by
Diff: robot.cpp
- Revision:
- 32:ff71f61bb9f6
- Parent:
- 29:1132155bc7da
- Child:
- 34:4ad11cda1eca
diff -r 4ef53fbd6759 -r ff71f61bb9f6 robot.cpp
--- a/robot.cpp Sat Mar 22 00:38:12 2014 +0000
+++ b/robot.cpp Sat Mar 22 20:17:29 2014 +0000
@@ -15,7 +15,7 @@
//set our set point in memory to match the current set point of the encoders
const int *referenceCounts = bigenc.getReferences();
- motors.setSetPoint(referenceCounts[0],referenceCounts[1]);
+ motors.setSetPoint(referenceCounts[1],referenceCounts[0]);
//storage for shape positions
circleX=circleY=rectX=rectY=rectRot=triX=triY=triRot=0;
@@ -98,6 +98,8 @@
//DBGPRINT("%d: %d\t%d\r\n",i,move,totalMove);
while(tim.read_ms()<5);
gyro.gyroUpkeep();
+
+ //compass calibration code, shouldn't be needed
if(distance==16000 && maxSpeed == 6){
if(gyro.xmag>xMaxVal)
xMaxVal=gyro.xmag;
@@ -120,6 +122,8 @@
while(tim.read_ms()<10);
}
gyro.start();
+
+ //compass calibration code, should never run
if(distance==16000 && maxSpeed == 6){
double xAvg = 75.0*(double)xSumVal/(startFall+stepsToMax);
double zAvg = 75.0*(double)zSumVal/(startFall+stepsToMax);
