Wednesday, February 10, 2010

EFORSB v2 programming Sneak peak

You all noticed that I have RobotC now, and I actually have alot of programs for the EFORSB v2.

The First Entry is an if-then statement:

task main()
{
while(true)
{
motor(motorA) = 75;
motor(motorB) = 75;
motor(motorC) = 75;
{
if(SensorValue(S4) > 25)
{
motor(motorA) = 75;
motor(motorB) = 38;
motor(motorC) = 75;
}
else
{
motor(motorA) = 75;
motor(motorB) = 75;
motor(motorC) = 38;
}
wait1Msec(3000);
}
}
}

the second entry is a basic programming that is fairly simple "as well as my first" :

task main()
{
motor(motorA) = 75;
motor(motorB) = 75;
motor(motorC) = 75;

while(SensorValue(S4) > 25)
{
motor(motorA) = 75;
motor(motorB) = 38;
motor(motorC) = 75;
wait1Msec(3000);
}
motor(motorA) = -75;
motor(motorB) = -75;
motor(motorC) = -75;

while(SensorValue(S1) == 0);
{
motor(motorA) = 0;
motor(motorC) = 0;
motor(motorC) = 0;
}
}

No comments:

Post a Comment