Near the end of the practice, we had a mini sumo challenge Jaret has been dreaming of since day one. The robot that could push the other one out of an area. Jaret won the competition while his robot played a "battle tone". Below is a video from the challange.
Saturday, July 30, 2011
July 30, 2011 Practice
Today we finished our TETRIX creations from last week. Jared was on vacation so Jaret was working alone. After our countless minutes of constructing, we started programming our robots. We started with making the robots go forward, which was all we could do with our starter-robots.
Saturday, July 16, 2011
July 16, 2011 Practice
Ian and I work on our robotic creation featuring "brains". |
Jared and Jaret worked on a robotic creation featuring mechanics and "sumo skills". |
Saturday, July 9, 2011
July 9, 2011 Practice
Our new robot design with treads. |
#pragma config(Sensor, S2, FloorColor, sensorCOLORFULL)
#pragma config(Motor, motorB, RightWheel, tmotorNormal, PIDControl, encoder)
#pragma config(Motor, motorC, LeftWheel, tmotorNormal, PIDControl, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
void color_read();
void white_task(int forward_speed);
void black_task(int reverse_speed);
int read_output;
task main()
{
int universal_speed = 25;
while(1 == 1)
{
color_read();
switch(read_output)
{
case 6 :
white_task(universal_speed);
break;
case 1 :
black_task(universal_speed);
break;
}
}
}
void color_read()
{
bool value_ready = false;
while(!value_ready)
{
int A = SensorValue[FloorColor];
int B = SensorValue[FloorColor];
int C = SensorValue[FloorColor];
if(A == B && B == C && C == A)
{
read_output = C;
value_ready = true;
}
else
{
value_ready = false;
}
}
}
void white_task(int forward_speed)
{
motor[RightWheel] = forward_speed;
motor[LeftWheel] = forward_speed;
}
void black_task(int reverse_speed)
{
motor[RightWheel] = 0 - reverse_speed;
motor[LeftWheel] = 0 - reverse_speed;
}
Subscribe to:
Posts (Atom)