
hi technic color sensor help. plz save us oh mighty internet
i have a class of 5 others in my robotics 2 class.

<-(me)

we love this class the best out of our day. currently we are working on a color sensing robot that can sort colored balls(highly origanal)
we have all apparently biult robotic arms that will pick the balls up.
(yes i now realize that there are mush simpler ways of doing this)
i have figured out how to tell the color sensor what color is what, and how to display it onto the screen. the only problem is how to tell the robot to do a order of comands after it knows what color it has in it powerful grasp. right now it is trying to do them all at once and some times it wont stop. i have been stuck in the same place for about a week and the teacher is no real help it seems that i know more than he does, anyway before i lose my already dwindling sanity plz help us. i only have blue right now.
CODE__________________________________________________________
#pragma config(Sensor, S1, colorPort, sensorI2CHiTechnicColor)
#pragma config(Motor, motorA, claw, tmotorNormal, PIDControl, encoder)
#pragma config(Motor, motorB, vertical, tmotorNormal, PIDControl, encoder)
#pragma config(Motor, motorC, base, tmotorNormal, PIDControl, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
string sColor;
while (true) {
switch (SensorValue[colorPort])
{
case 2: sColor = "Blue";
motor[motorA]=-10; //claw close
wait1Msec(200);
motor[motorB]=5; //arm rise
wait1Msec(100);
motor[motorC]=10; //base turn right
wait1Msec(4000);
motor[motorB]=-10; //arm goes down
wait1Msec(2000);
motor[motorA]=10; //claw open
wait1Msec(255);
motor[motorB]=10;//arm goes Up
wait1Msec(352);
motor[motorC]=30; //base turns
wait1Msec(500);
motor[motorB]=-10; //arm goes down
wait1Msec(500);
motor[motorC]=50; //base turns
wait1Msec(800);
break;
case 4: sColor = "Green"; break;
case 6: sColor = "Yellow"; break;
case 8: sColor = "Red"; break;
default: sColor = "(>^^)>@<(^^<)"; break;
}
nxtDisplayCenteredTextLine(2, sColor);
wait1Msec(50000);
}
}
---------------------------------------------------------------------------
sesion terminated----
