Hello everyone
I have a robot model of VEX V.05, I built it and checked his movements by remote control,
I want to program it to work alone using several simple commands.
First I want to understand the electrical diagram of microcontroller I mean,
the use of I / O of PIC18F8520, I’d love to see a link on this issue.
I know how to program the pic18 mplab environment, and program c language,
How do I start programming my robot to perform simple commands
Such as reverse, drive forward, turn right, turn left
I would be happy if something could help me
Note: I am open to suggestions also use other programs if they are more simple and my robot’s programming.
Thank you all,
First you will need an orange programming cord, you can get that from VEX.
Your best source of information on the MPLab / environment is Kevin Watson’s FRC site. That controller uses the PIC processor about 99% of what he describes can be used for the VEX. Kevin VEX page has the VEX specific code.
While I’ve written a ton of bit bang code for the PIC, a super of libraries that can be used is the WPI Library
I’d suggest go through those pages and you’ll have a better idea for your next set of questions.
I used the MPLabs setup for a long time. We presently use RobotC and like it. It’s well worth the $40.
When the robot does things by itself, its called “autonomous” here.
In Vex competitions, there is an Autonomous phase, followed by a driver-controlled phase. The driver-controlled period can also have cyborg-aided or other pre-programmed elements if desired. If you are doing non-contest related development, then you don’t need to worry about contest templates to control the time periods and switching between phases.
Its fun, but generally not necessary to understand the electrical diagram at this point in your robot skill development. I don’t know MPLab, so I cant recommend how to get started with autonomous. EasyC or RobotC (not for Cortex) is an easy way to get started with C. There are some links around the forums for “Vex under Unix”, look for poster MarkO, if that appeals to your situation.
Commands in the EasyC and RobotC libraries let you get the joystick values, and set motor values. If you want “simple commands like drive forward”, you’ll need to write them yourself, or find them elsewhere here in the forums.
The simplest type of C function for drive-forward would accept two parameters, (Speed, time in ms). Unless you have some kind of sensors like optical wheel encoders, you’ll only be able to do time-based commands, rather than wheel-rev based commands like “drive forward 300 counts”.