|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Don't Laugh - Remember I'm New ... Robovation Kit
Hi.
Is it possible to program the Robovation Kit such that it will run "autonomously" for a given length of time and then stop? In other words, since we don't have a RC transmitter / receiver to use right now - can we still get the thing to do what we want without it? Thanks, Murf ![]() |
|
#2
|
|||
|
|||
|
Re: Don't Laugh - Remember I'm New ... Robovation Kit
Yes, this is actually quite easy, and no it was not a dumb question.
The best I can explain it would be through code: Code:
unsigned long int timer = 0;//Global variable declared right under the includes
...Code ommited for posting purposes...
//This function gets called every 17ms, therefore you just use a global variable that increments everytime this function is called to keep track of the time that is going by.
void Process_Data_From_Master_uP(void)
{
Getdata(&rxdata); /* Get fresh data from the master microprocessor. */
Default_Routine(); /* Optional. See below. */
/* Add your own code here. */
if(timer <= 85)//Both pwms full forward for first 5 seconds (17 * 5= 85)
{
pwm07 = 255;
pwm08 = 255;
}
else if(timer > 85 && timer <= 119)//For next 2 seconds turn
{
pwm07 = 0;
pwm08 = 255;
}
else //else sit there
{
pwm07 = 127;
pwm08 = 127;
}
timer++;//Increment the variable
printf("PWM OUT 7 = %d, PWM OUT 8 = %d\n",(int)pwm07,(int)pwm08); /* printf EXAMPLE */
Putdata(&txdata); /* DO NOT CHANGE! */
}
. Basically you just use this function to simulate autonomous, but if you need something to update faster then 17ms you need to place it in a different spot. |
|
#3
|
|||
|
|||
|
Re: Don't Laugh - Remember I'm New ... Robovation Kit
Thanks Ken! I appreciate the help.
Murf |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Robovation Robot kit | cmmarkes | Robotics Education and Curriculum | 4 | 24-01-2005 17:24 |
| Please Help: Programming the Robovation Kit | wmurphy | Robotics Education and Curriculum | 14 | 08-12-2004 12:57 |
| robovation KIT help | Mirza95vx | Technical Discussion | 2 | 03-12-2004 15:08 |
| 2004 WPI EBOT Competition (using Robovation robots) | ahecht | Off-Season Events | 3 | 04-11-2004 21:25 |