|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: Rookie help
Quote:
http://innovationfirst.com/FIRSTRobo...04-Jan-14a.pdf http://innovationfirst.com/FIRSTRobo...10-15-2003.pdf http://innovationfirst.com/FIRSTRobo...t_02-16-04.zip |
|
#2
|
|||
|
|||
|
Re: Rookie help
And I just use MPLAB IDE to mess with it right?
Also, what kind of code am i looking for just to make these things move for starters What code(s) will I have to upload as well? Last edited by doyler : 20-12-2004 at 16:16. |
|
#3
|
|||||
|
|||||
|
Re: Rookie help
Quote:
How about putting something like this where it says "/* Add your own code here. */" in the file "user_routines.c" in the routine "Process_Data_From_Master_uP" Code:
static unsigned char servo1=0; //Put these two lines right before the "Getdata" call
static unsigned char counter=0; // ditto
//Put these lines after "Add your own code"
if (counter < 20) // about half a second in the slow loop
counter++;
else
{
counter = 0;
if (servo1 < 255)
servo1++; // servo1 will slowly step through each of it’s positions
else
servo1 = 0; // servo1 will quickly reset to the zero position
}
pwm03 = servo1;
Last edited by Mark McLeod : 21-12-2004 at 15:03. Reason: explicit type unsigned |
|
#4
|
|||
|
|||
|
Re: Rookie help
Thank you, i will fiddle and learn from that code (is user routines akin to autonomous cause i dont know how im gonna make them move if it isnt)
1 more question (i hope) how and what do i upload to my controller now? Last edited by doyler : 20-12-2004 at 16:34. |
|
#5
|
|||||
|
|||||
|
Re: Rookie help
Quote:
Last edited by Mark McLeod : 21-12-2004 at 08:29. Reason: Added innovationfirst link and clarified notes for later readers |
|
#6
|
|||
|
|||
|
Re: Rookie help
C:\...\EDU_Default_02-16-04\user_routines.c:249:Error: syntax error
Halting build on first failure as requested. BUILD FAILED: Mon Dec 20 16:36:48 2004 here is the snippet i edited Code:
/*******************************************************************************
* FUNCTION NAME: Process_Data_From_Master_uP
* PURPOSE: Executes every 17ms when it gets new data from the master
* microprocessor.
* CALLED FROM: main.c
* ARGUMENTS: none
* RETURNS: void
*******************************************************************************/
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. */
static char servo1=0;
static char counter=0;
if (counter < 20) // about half a second in the slow loop
counter++;
else
{
counter = 0;
if (servo1 < 254)
servo1++; // servo1 will slowly step through each of it’s positions
else
servo1 = 0; // servo1 will quickly reset to the zero position
}
pwm03 = servo1;
printf("PWM OUT 7 = %d, PWM OUT 8 = %d\n",(int)pwm07,(int)pwm08); /* printf EXAMPLE */
Putdata(&txdata); /* DO NOT CHANGE! */
}
|
|
#7
|
|||||
|
|||||
|
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 |
|
#8
|
|||
|
|||
|
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] |
|
#9
|
|||||
|
|||||
|
Re: Rookie help
Quote:
![]() |
|
#10
|
|||
|
|||
|
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. |
|
#11
|
|||||
|
|||||
|
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. |
|
#12
|
|||||
|
|||||
|
Re: Rookie help
Quote:
http://www.keyspan.com/downloads/win/ |
|
#13
|
|||
|
|||
|
Re: Rookie help
2 questions
For that code do i have to plug them into certain pwm outs? Also, will my code just start? |
![]() |
| 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 |