|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
hey i have a question. i am playing with the little bot in preparation for this up coming regional (if we get money
) and i want to know how to make the bot do things using time, like run this motor for x amount of time then switch and do this. could you help me out because our programmers who knew what they were doing left last year and me and the other programmer are doing this for the first time and the only backgroung i have w/programming is from my sam's teach yourself C. i tried a few things but i had no luck. also how could i make an r\c controller to plug into the little box to control it remotely? any help w/this would be appreciated greatly. ![]() |
|
#2
|
|||||
|
|||||
|
Re: Please Help: Programming the Robovation Kit
Looks like you want to set a counter
Declare a variable counter: int counter; if (counter<100) { pwm01=254; pwm02=254; counter++; } if (counter<200) { pwm01=180; pwm02=180; counter++ } //EDIT: had wrong code earlier on, this one should work // and continue on.. Another way it to use Timers. I would suggets looking at all the help documents included with the compiler and at innovationfirst.com . If you study those and test, you will get where you have to, it has almost anything you need. Yet, if you need help feel free to post Regarding your second question, are you using a full size controller of robovation? Last edited by Bharat Nain : 06-12-2004 at 22:02. |
|
#3
|
|||||
|
|||||
|
Re: Please Help: Programming the Robovation Kit
Quote:
static unsigned int intCycles = 0; static unsigned int intSeconds = 0; in Process_Data_From_Master_uP: Code:
cycleCounter = cycleCounter + 1; intSeconds = cycleCounter / 59; Code:
if(intSeconds > 5) // just an example
{
// do your code
}
|
|
#4
|
||||
|
||||
|
Re: Please Help: Programming the Robovation Kit
The above suggestions will work but are not totally deterministic. If you add code (particularly debug printf statements) the timing can be affected.
I implemented the interrupt timer outlined in Timers_White_Paper and it works like a champ. |
|
#5
|
||||
|
||||
|
Re: Please Help: Programming the Robovation Kit
thank you to all of you, i will try all of your suggestions and see which one works best. I would look for that documentation but i think we might have lost it last year but i'll check. Abyways this might help us with autonomous mode this year because last year we got it to follow the line (which was really hard and pretty good i think for a rookie team) and it didn't quite work. And about my second question i was wondering if there were any what kind of r/c controller i could use on the little box to make it remote controled . Like would i have to customly wire like an r/c car control unit into it or use like the big controller from the big kit?
![]() |
|
#6
|
||||
|
||||
|
Re: Please Help: Programming the Robovation Kit
Quote:
|
|
#7
|
||||
|
||||
|
Re: Please Help: Programming the Robovation Kit
so what just wire the r/c outputs from the car to the r/c pwm in?
|
|
#8
|
||||
|
||||
|
Re: Please Help: Programming the Robovation Kit
Quote:
|
|
#9
|
|||||
|
|||||
|
Re: Please Help: Programming the Robovation Kit
Quote:
|
|
#10
|
||||
|
||||
|
Re: Please Help: Programming the Robovation Kit
wel i would do what that guide said but we don't have $150 - $200 for a hobby r/c controller, as it is we don't even have money to register yet. but that other guide for timers worked with a few mods. thanks
![]() |
|
#11
|
|||
|
|||
|
Re: Please Help: Programming the Robovation Kit
I haven't had a chance to put together formal documentation, but there is a Windows applications and C code library that you can use to control the mini-RC from your PC. You can download a sample project and the windows program from http://members.cox.net/seanwitte. The project is for the newest version of MPLAB so you might need to create a new workspace and manually add the .c, .h, .lkr, and .lib files to it.
Sample screen shots are in this document. The project is set up as a single-stick drive using PWM outputs 1 and 2. Joystick 1 in the PC interface is used as the drive input. If you download the hex file and connect to the RC from PCInterface you will need to check the Enable checkbox before it will run. If you have an Analog Devices ADXRS150EB gyro connected to input 1 the sample program will integrate the signal and send the value back as analog feedback channel 1. In the program the value will be robot.heading, in the robot struct defined in robot.h. If you click the "Show Workspace" button you'll see a model of the robot rotating in realtime as you move the gyro. Feel free to send a PM if you need help. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programming - Getting Started | Mark McLeod | Programming | 80 | 16-04-2008 23:37 |
| Robovation Robot kit | cmmarkes | Robotics Education and Curriculum | 4 | 24-01-2005 17:24 |
| 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 |