|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
|||||
|
|||||
|
Re: Rookie help
Variable declarations must be at the very beginning of a routine. I noted that above in an edit after my original post. Sorry about that.
Quote:
Last edited by Mark McLeod : 21-12-2004 at 16:40. Reason: Fixed incorrect comment. Slow loop = 59/sec in EDU 38 in FRC |
|
#17
|
|||
|
|||
|
Re: Rookie help
Error - Source file 'C:\...\ifi_utilities.c' name exceeds file format maximum of 62 characters.
silly mplab [edit] hmm, do i need to install my usb to serial converter? [/edit] |
|
#18
|
|||||
|
|||||
|
Re: Rookie help
Quote:
![]() |
|
#19
|
|||
|
|||
|
Re: Rookie help
yeah, but i have a keyspan usb -> serial
does xp not auto add it? [edit] Build Succeeded! now to add it to the controler [/edit] Last edited by doyler : 20-12-2004 at 17:00. |
|
#20
|
|||||
|
|||||
|
Re: Rookie help
Quote:
Are you getting a download error using IFI_Loader? Sometimes those adaptors auto connect to a different COM port than it advertises. You can run through and try all the possible COM ports in IFI_Loader by choosing "PortSettings" and COM1, try to download, then COM2, and try to download, etc. [edit] I misunderstood. Do you have the controller or will you try that later? For those of you reading along... The error doyler got was because one of the path and filenames was too long for MPLAB to handle. Combined they cannot be more than 62 characters or so. The usual solution is to keep the directory for all your FIRST code at the top level of the C drive, i.e., "C:\FIRST" not on your desktop because that's really at "C:\Documents and Settings\doyler\Desktop\" which is already 41 characters long. Last edited by Mark McLeod : 20-12-2004 at 18:35. |
|
#21
|
|||||
|
|||||
|
Re: Rookie help
Quote:
http://www.keyspan.com/downloads/win/ |
|
#22
|
|||
|
|||
|
Re: Rookie help
2 questions
For that code do i have to plug them into certain pwm outs? Also, will my code just start? |
|
#23
|
|||||
|
|||||
|
Re: Rookie help
Quote:
Code:
pwm03 = servo1; The code should start immediately after the download has completed. |
|
#24
|
|||
|
|||
|
Re: Rookie help
I charged my battery and the chargers light turned green
I plugged it in, the battery power and fault status lights blinked, but then nothing [edit] now battery power, program state, and fault status are blinking green while pwn in/radio is a constant red is this good? [/edit] |
|
#25
|
|||||
|
|||||
|
Re: Rookie help
Quote:
Now press the Prog button to get a solid orange LED. |
|
#26
|
|||
|
|||
|
Re: Rookie help
Ok it works
Now i just need to learn how, why, and how to change it First off: How would i make the program loop somewhat faster Last edited by doyler : 21-12-2004 at 14:56. |
|
#27
|
|||||
|
|||||
|
Re: Rookie help
Quote:
The servo will then take 1.4 minutes to move very slowly through a 60 degree turn before it quickly whips back to the "0" position and repeats. You can speed this up by changing the delay we built in. Code:
if (counter < 20) // about 1/3 second in the slow loop for one ~60/255 degree turn Last edited by Mark McLeod : 21-12-2004 at 16:44. Reason: mixed up my numbers: Slow loop = 59/sec in EDU 38 in FRC |
|
#28
|
|||
|
|||
|
Re: Rookie help
Code:
static unsigned char servo1=0; static unsigned char counter=0; (i will go through it step by step) |
|
#29
|
|||||
|
|||||
|
Re: Rookie help
Quote:
Yes, servo1 is the position you set for the servo to move to. You can actually set it to any value you like. For instance if you have an RC unit, you could use that to move the servo. The variable "servo1" could be completely replaced in this code sample with the system variable "pwm03" if you wanted. It isn't strictly needed, but it does make it easy to switch to a different pwm without having to change all your code. This routine (Process_Data_From_Master_uP) in the default code is called the slow loop. It executes about 59 times per second (in the EDU, FRC is 38 times per sec.), because that's how fast the radio packets come in. We're using that characteristic of the loop to make "counter" a cheap timer. Each loop equals 1/59 second, so "counter<59" , for example, will equal one second. [edit] P.S. You can also change "servo1++;" to something like "servo1 += 5;" to make the servo move faster still. But be careful that the logic of the check "if (servo1 < 255)" catches servo1 before it tries to become larger than 255. When that happens servo1 cannot hold a value larger than 255, so it will suddenly become a completely unexpected value. Last edited by Mark McLeod : 21-12-2004 at 16:46. Reason: mixed up my numbers: Slow loop = 59/sec in EDU 38 in FRC |
|
#30
|
|||
|
|||
|
Re: Rookie help
Yes, it worked
So 38 is 1 second? Then why is 2 faster then 20 I understand the variables part (except for the counter which is covered in the below code) Code:
if (counter < 2) // about half a second in the slow loop for one 60/255 degree turn (2 = 7 seconds, 20=2 minutes) counter++; [edit] i dont understand your edit fully [/edit] Last edited by doyler : 21-12-2004 at 15:27. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Rookie 2005 Nats Qualification? | Alexander McGee | Championship Event | 2 | 27-10-2004 10:14 |
| Senior Project 05: Mini competition to help fundraise for local rookie teams | Alex Cormier | Fundraising | 0 | 07-10-2004 15:58 |
| Rookie Regionals | rachakate | Regional Competitions | 5 | 24-03-2004 00:01 |
| I want to have a rookie nationals! | Tton | Championship Event | 5 | 23-04-2003 14:46 |