|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#16
|
|||||
|
|||||
|
Re: Programming - Getting Started
Quote:
Teams are permitted to connect to four specific pins on the Competition Port, in order to 1) enable additional frequencies for practicing with multiple robots, 2) activate autonomous mode for testing, and 3) disable the robot. Most teams build a box with two or three switches that connects to the port. That box is called a dongle. The Competition Port Pinout Guide shows how to construct one. |
|
#17
|
|||||
|
|||||
|
Re: Programming - Getting Started
Here's an updated version for this year with 2005 links included.
Programming Quick Start
v FRC (Full-size Robot Controller) RC Default Code
v C Programming Resource Library http://www.usfirst.org/robotics/C_help.htm has a great overview of the programming process.
v c18_getting_started_2.4.pdf http://ww1.microchip.com/downloads/en/DeviceDoc/MPLAB_C18_Getting_Started_51295d.pdf
Last edited by Mark McLeod : 27-01-2005 at 12:29. |
|
#18
|
|||
|
|||
|
Re: Programming - Getting Started
*waves hand* hi... I'm another of the newbies with little (read, none) experience working with C. I am also the only one on my team doing the programming dance. At the moment I'm teaching myself from whatever tutorials I can find, but if anyone can spare a moment or ten through e-mail or IM to answer my questions, I would be muchly indebted to you.
AIM- daemonlvr856 e-mail- krystal_dragon9@yahoo.com THANK YOU!!! ~kat |
|
#19
|
|||
|
|||
|
I'm another newbie, with probably less experience than the other two and just as hopeful maybe someone could give me some time cause i'm running into problems i don't know how to solve. Any help is welcome via im or e-mail or anything.
Team 695 |
|
#20
|
|||
|
|||
|
Re: Programming - Getting Started
I have another one i forgot about, when I try to build the error is that it can't locate the build tool, any insight?
|
|
#21
|
|||||
|
|||||
|
Re: Programming - Getting Started
I really am a newbie. Heres proof. Can I call the function Limit_Mix as it exists in the v2.4 code from the autonomous mode section of user_routines_fast.c? I was under the impression that I can, but when I just tried to compile it gave me warnings about no function prototype (whatever that is
), but it seems to have compiled anyway. Anyone? |
|
#22
|
|||||
|
|||||
|
Re: Programming - Getting Started
Quote:
You just need to tell the compiler a little bit about the function Limit_Mix. A function prototype does this, and it can be added to the top of your user_routines_fast.c file, or better yet to the user_routines.h file that gets included by user_routines_fast.c, like so: Code:
unsigned char Limit_Mix (int); Prototypes is one of the main uses of the .h files, so any other file that needs to use Limit_Mix for example, will just need to include "user_routines.h" Last edited by Mark McLeod : 16-02-2005 at 11:50. |
|
#23
|
||||
|
||||
|
Re: Programming - Getting Started
can anyone help me out with programming the buttons on the joy sticks`
|
|
#24
|
|||||
|
|||||
|
Re: Programming - Getting Started
Quote:
For Joystick Port 1:
p2_sw_top would be on joystick Port 2, p3_sw_top on Port 3, etc. They are used in your code like this: Code:
if (p2_sw_top == 1)
printf("Hello FIRST\r");
else
printf("Goodbye cruel world\r");
Last edited by Mark McLeod : 20-02-2005 at 01:59. |
|
#25
|
|||
|
|||
|
Re: Programming - Getting Started
Mark:
Great review, could you post a link to the latest default code v. 2.4 for 2005; I downloaded the file from http://www.ifirobotics.com/rc.shtml#Programming and upon extracting it there is nothing in the files. Maybe someone else has a good copy. Thanks. ![]() |
|
#26
|
|||||
|
|||||
|
Re: Programming - Getting Started
Quote:
http://www.ifirobotics.com/docs/frc-...2-2005v2.4.zip |
|
#27
|
|||
|
|||
|
Quote:
![]() |
|
#28
|
|||
|
|||
|
Quote:
Now, why do you say use a switch you may wonder? And why use a normally off/open switch? If your robot goes on an evil plot to kill you and you start to run away, you will let go of the switch, and the robot won't do autonomous anymore. OK, newcomers, there are a few tips that I myself have: 1. Programming takes time. If it doesn't work correctly/compile on the first attempt, and you can't figure out what is wrong, Save the file, close out MPLAB, and go do something for an hour then come back. It will probably hit you then. 2. Pay attention to the default code. It is your friend. It will tell you just about absolutely everything you need to know to program the robot. 3. Autonomous mode is not hard, you just need to think about it. Remember, there is a 40ms clock in the RC, so 1 second = 26.2ms. This would be a good time for a calculator. 4. NEVER DELETE OLD CODE. 5. Always put new code, even if you're only changing a comment, in a new folder. SAVE AN ENTIRE SEPARATE COPY! 6. NEVER DELETE OLD CODE. Those should be your ground rules. Enjoy ![]() Last edited by RIgnazio : 23-09-2005 at 10:15. Reason: 40ms is wrong, it should be 26.2ms |
|
#29
|
||||
|
||||
|
Re: Programming - Getting Started
Quote:
Quote:
I'm not sure where you got 40ms, but my memory is bad, and I remember two loops running in the RC, perhaps you're referring to a separate one than I am. |
|
#30
|
|||
|
|||
|
Re: Programming - Getting Started
>> 3. Autonomous mode is not hard, you just need to think about it. Remember, there is a 40ms clock in the RC, so 1 second = 26.2ms. This would be a good time for a calculator.
Maybe it should read 40MHZ clock in the RC. There is a 26.2ms sample time in the outer/main loop where you get new input from the operator station so in 1 second that is 40hz, i.e. 40 samples per second (actually is 28.167...hz, but 40hz is probably close enough)? Not really sure what the intent was, I'm having trouble parsing the line. Bud |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Book on C programming - suggestions? | wun | Programming | 18 | 14-01-2005 00:12 |
| Help needed for getting started! | chantilly_team | Programming | 4 | 27-10-2004 08:29 |
| Autonomous Programming Competition Signup List | SilverStar | Programming | 36 | 13-05-2004 15:09 |
| Robot Programming Education | phrontist | Programming | 11 | 03-05-2004 07:32 |