Tuesday, June 28, 2011

June 28, 2011 Practice

Today was a small meeting with only Jared and I, due to Ian and Jaret both taking family vacations. Together, we accomplished creating a claw and giving the robot a better rear "wheel". We also discussed ideas for our claw and robot. In the programming department, I made a program that starts in a box and travels to the other end than turns around. To help with motors, I created a global variable for motor offset. In my opinion, this was one of our most successful meetings yet.

Here is a small sample of code from the program that turns at line (I did not define the functions):
task main()
{
  int universal_speed = 50;
  int light_threshold = 45;
  straight(universal_speed, false);
  wait1Msec(1250);
  straight(universal_speed, true);
  while(1 == 1)
  {
    while(SensorValue[Light_R] >= light_threshold)
    {
      straight(universal_speed, false);
    }
    straight(universal_speed, true);
    turn_r(universal_speed, light_threshold);
  }
}

No comments:

Post a Comment