|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
kevin watsons scripting . . .
I have kevins nav code, and I have my drive commands entered and those work just great. Now I just need some help with the autonomous scripting. I know that its supposed to be easy, and from what I have read, it seems as though it is very easy. But after looking through the code, and reading tons of things on scripting and coding, I still need some help. I need someone to give me some code that will get my scripting commands in the command.h file to start running in auton. I dont know how to start the auton to test it. I dont really know antything about auton at all. PLEASE help me get started on this! Time is running out, I only have 5 days left!
|
|
#2
|
||||
|
||||
|
Re: kevin watsons scripting . . .
All you need to do is put robot_control(); in user_routines_fast.c
Code:
while (autonomous_mode) /* DO NOT CHANGE! */
{
if (statusflag.NEW_SPI_DATA) /* 26.2ms loop area */
{
Getdata(&rxdata); /* DO NOT DELETE, or you will be stuck here forever! */
/* Add your own autonomous code here. */
robot_control(); //call automous mode
Generate_Pwms(pwm13,pwm14,pwm15,pwm16);
Putdata(&txdata); /* DO NOT DELETE, or you will get no PWM outputs! */
}
}
}
Quote:
|
|
#3
|
|||
|
|||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Scripting Setup and the Camera + Serial Port Drivers | CJO | Programming | 22 | 11-01-2006 17:42 |
| 2005 Autonomous Scripting Manual | Anthony Kesich | Programming | 31 | 17-02-2005 17:30 |
| Kevin Watson's encoder code with RPM output | MaxM | Programming | 2 | 05-02-2005 00:06 |
| Kevin Watson's Kick-off Demo Code! | Mr. Lim | Programming | 27 | 22-01-2005 03:38 |