|
Re: kevin watsons scripting . . .
It actually isn't really hard at all. I have been able to make a small code, but it hasn't worked for my bot yet :/ . Anyway, to use it, go to the top and under the part that says something like "declare all variables here" put "static unsigned int t;" Then, in the area mentioned by Chakorules that says "add your own autonomous code here" put this:
t++;
if (t < 95) //turn left for 2.5 seconds
{
pwm01 = 95; //left motor goes in reverse
pwm02 = 150; //right motor goes forward
}
else if (t < 285) //go straight for 5 seconds
{
pwm01 = 150;
pwm02 = 150;
}
else if (t < 380) //turn right for 2.5 seconds
{
pwm01 = 150;
pwm02 = 95;
}
else //stop after 10 seconds
{
pwm01 = 127;
pwm02 = 127;
}
I( am not sure if this will work 100%, considering this is my first year as a freshman, but if you put this part of the code in a loop, is really should work. well, i hope this helped. see you at the competition.
|