|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am using the following code to make our robot follow the line but it won't build and i was wondering if anyone could help me out cuz i am frantic...
void User_Autonomous_Code(void) { while (autonomous_mode) { if (statusflag.NEW_SPI_DATA) { Getdata(&rxdata); // bad things will happen if you move or delete this // Autonomous code goes here. digital_io_1 = 1; if(rc_dig_1 ==1 ) { pwm13 = 137 pwm14=100; { else { pwm13 = pwm14 = 140; } if(rc_dig_2 == 1) { pwm13 = 100 pwm = 137; } else { pwm13 = pwm14 = 140; } Generate_Pwms(pwm13,pwm14,pwm15,pwm16); Putdata(&txdata); // even more bad things will happen if you mess with this } } } Thanks!!!! |
|
#2
|
||||
|
||||
|
Re: Why doesn't this work??!??!!?!!!?!?
Could you copy the output from the failed build here? I think your problem is missing a few closing brackets, but it's hard to tell. The output should make it very easy to solve.
![]() |
|
#3
|
|||
|
|||
|
sure can here it is:
Deleting intermediary files... done. Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8520 "ifi_startup.c" -fo="ifi_startup.o" /i"C:\MCC18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8520 "ifi_utilities.c" -fo="ifi_utilities.o" /i"C:\MCC18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8520 "main.c" -fo="main.o" /i"C:\MCC18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8520 "printf_lib.c" -fo="printf_lib.o" /i"C:\MCC18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8520 "receiver.c" -fo="receiver.o" /i"C:\MCC18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8520 "tracker.c" -fo="tracker.o" /i"C:\MCC18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8520 "user_routines.c" -fo="user_routines.o" /i"C:\MCC18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8520 "user_routines_fast.c" -fo="user_routines_fast.o" /i"C:\MCC18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- H:\Working on it\Robot\frc_tracker\user_routines_fast.c:201:Erro r: syntax error Halting build on first failure as requested. BUILD FAILED: Thu Mar 04 15:15:45 2004 hope that it will help you to help me!! |
|
#4
|
|||||
|
|||||
|
Re: Why doesn't this work??!??!!?!!!?!?
Quote:
At line 14, use } instead of { (I asume that was a copy error). Where is the error? double click it in the build window to see. (line 22, probably) If you're using the yellow Banner sensors, what wire are you connecting to the FRC? And, compared to the line, are far apart are they? |
|
#5
|
|||
|
|||
|
That was not the error because when i fixed it i still get the same error and i do not know where the error is but i wish that i did!!!!
|
|
#6
|
|||||
|
|||||
|
Re: Why doesn't this work??!??!!?!!!?!?
Here are a couple of corrections.
Code:
void User_Autonomous_Code(void)
{
while (autonomous_mode)
{
if (statusflag.NEW_SPI_DATA)
{
Getdata(&rxdata); // bad things will happen if you move or delete this
// Autonomous code goes here.
// digital_io_1 = 1; /* Belongs in User_Initialization */
if(rc_dig_in01 ==1 )
{
pwm13 = 137;
pwm14=100;
}
else
{
pwm13 = pwm14 = 140;
}
if(rc_dig_in02 == 1)
{
pwm13 = 100;
pwm14 = 137;
}
else
{
pwm13 = pwm14 = 140;
}
Generate_Pwms(pwm13,pwm14,pwm15,pwm16);
Putdata(&txdata); // even more bad things will happen if you mess with this
}
}
}
Last edited by Mark McLeod : 04-03-2004 at 15:20. |
|
#7
|
|||
|
|||
|
YESSSSSSSSSSSSSSSSS!!!!!!!!!!!!!!!!!
thank you!!!!!!!!!!!!!!!!!!!!!!!!!! |
|
#8
|
|||||
|
|||||
|
Re: Why doesn't this work??!??!!?!!!?!?
Quote:
Which one? line 14 or 22? and what is it now? (or 13? I just found that) Also, see the pic for what I mean. |
|
#9
|
|||||
|
|||||
|
Re: Why doesn't this work??!??!!?!!!?!?
Quote:
Good luck! |
|
#10
|
||||
|
||||
|
Re: Why doesn't this work??!??!!?!!!?!?
Engineers are easily amused :^)
|
|
#11
|
|||||
|
|||||
|
Re: Why doesn't this work??!??!!?!!!?!?
Quote:
![]() |
|
#12
|
||||
|
||||
|
Re: Why doesn't this work??!??!!?!!!?!?
note - you can put multiple commands on the same line if you want - just make sure you still have a semicolon after each command, just as you would if they were on separate lines. semicolons are not line separators, they are instruction separators.
|
|
#13
|
|||||
|
|||||
|
Re: Why doesn't this work??!??!!?!!!?!?
So similarly, Can you put 1 command across multiple lines? I mean with the compiler, not the language.
|
|
#14
|
||||
|
||||
|
Re: Why doesn't this work??!??!!?!!!?!?
if it's anything like a normal C compiler, you should be able to. no guarantees, though.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 3D Studio Max won't work | David the bomb | 3D Animation and Competition | 3 | 03-03-2004 17:12 |
| Problems of the mind... effecting work | Gadget470 | Chit-Chat | 20 | 18-11-2003 11:56 |
| Edit doesn't work on original title posts??? | Elgin Clock | CD Forum Support | 6 | 12-03-2003 17:30 |
| Who knows how the motors [I]really[/I] work? | Wetzel | Chit-Chat | 5 | 13-02-2002 21:50 |
| Does anyone on this board work at home depot? | mnkysp6353 | General Forum | 2 | 30-12-2001 13:27 |