DtD
10-02-2009, 23:38
We decided that we were going to program an alternate plan for our Autonomous code, so I wrote some code and wired it up today...but I got some strange numbers.
The number was just a really long decimal that slowly incremented or decremented.
I'm thinking that the cable must just be soldered badly or something, but I ran out of time, and thought I should ask here so I don't waste too much time on Thursday.
Here is the code (stripped down really far:)
Gyro* gyro;//Declaration
gyro = new Gyro(1,1);//Inilization - In the robot startup
gyro->Reset();//In AutonomopusInit()
//Code in Autonomous Periodic - int countdown is just to keep the terminal from overflowing.
if (--countdown<=1)
{
echo("Gyro Rotation: "<<gyro->GetAngle()<<" Degrees\n");
countdown=50;
}
~DtD
The number was just a really long decimal that slowly incremented or decremented.
I'm thinking that the cable must just be soldered badly or something, but I ran out of time, and thought I should ask here so I don't waste too much time on Thursday.
Here is the code (stripped down really far:)
Gyro* gyro;//Declaration
gyro = new Gyro(1,1);//Inilization - In the robot startup
gyro->Reset();//In AutonomopusInit()
//Code in Autonomous Periodic - int countdown is just to keep the terminal from overflowing.
if (--countdown<=1)
{
echo("Gyro Rotation: "<<gyro->GetAngle()<<" Degrees\n");
countdown=50;
}
~DtD