Help !!!

Hi,

When I compile today, I get this problem

Clean: Deleting intermediary and output files.
Clean: Done.
Executing: “C:\MCC18\bin\mcc18.exe” -p=18F8722 “autonomous.c” -fo=“autonomous.o” -k -mL -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
C:\ifi_frc_simple_30\ifi_frc.h:31:Error [1027] unable to locate ‘p18cxxx.h’
C:\ifi_frc_simple_30\serial_ports.h:48:Error [1027] unable to locate ‘stdio.h’
MPLAB C18 v3.15 (demo)
Copyright 1999-2005 Microchip Technology Inc.
Days remaining until demo becomes feature limited: 60
Halting build on first failure as requested.

How can I solve it ? I am using MPLAB v8.00

hey our programmer said that you need to reinstall the upgrade for mplab 8 and make sure you have compiler v. 3

gotta fix your project’s search paths.
find the project settings in the project menu, and change the paths.
include -> mcc18/h
library -> mcc18/lib
linker -> mcc18/lkr

Can you say more detail ?

I have the v.3 compiler

Open MPLab, open the project, go to Project -> Build Options -> Project
Then on the General tab (or something like Paths in v8), set the links like this:
Linker -> mcc18/lkr
Library -> mcc18/lib
Include -> mcc18/h

where mcc18 is the path to your c18 installation

It seems that there is no such tab like you said

Well, look around and use common sense, there is one with paths, i know that for sure.

I have done like you said. Now there is another problem

Clean: Deleting intermediary and output files.
Clean: Done.
Executing: “C:\MCC18\bin\mcc18.exe” -p=18F8722 /i"C:\MCC18\h" “autonomous.c” -fo=“autonomous.o” -k -mL -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
MPLAB C18 v3.15 (demo)
Copyright 1999-2005 Microchip Technology Inc.
Days remaining until demo becomes feature limited: 60
C:\ifi_frc_simple_30\autonomous.c:242:Error: syntax error
Halting build on first failure as requested.

Well, check line 242 in the autonomous.c file, there’s a syntax error on that line.

void Autonomous_Spin(void)

This is the line. Is there any error ?

Check the lines above that for something like a missing brace or semicolon.

Since the C18 compiler gives ever-so-helpful error messages, I can’t say for sure, but I’m guessing the compiler was expecting a semicolon at the end of a statement or a closing curly-brace, but instead it found “void Autonomous_Spin(void)”.

The syntax error occurred on line 242, but the problem that caused it isn’t necessarily on that line. The actual problem is often on the line above the one the compiler says it is.

Without the surrounding code, it’s hard to tell. Based on that file name, I’m assuming you’re using Kevin’s v3 code, correct? Did you modify that file?

yeah i did modify the file.

I don’t have any code surronding that one

It said it’s version is v.0.1

Well, without the whole file, it’s hard to tell what’s wrong, but do you have semicolons and closing brackets everywhere? (Those would result in something more like “expected xx instead of yy” errors, though…)

Check the last few lines that have code on them that are before where you get the error.

Better yet, show those lines.

I’m pretty sure C18 doesn’t give “expected …” errors for missing/extra semicolons and braces.
It just says “syntax error”.

The only time it seems to give and “expected” error is when you use . instead of -> or the other way around.

yeah, you’re right, c18 doesn’t give those errors, even though it should.

void Teleop(void)
{
// enable this to use IFI’s default robot code
// Default_Routine(); // located in ifi_code.c
pwm01 = 255 - Limit_Mix(2000 + p1_y + p1_x - 127);
pwm02 = Limit_Mix(2000 + p1_y - p1_x + 127);
pwm10=pwm11=p2_x;
// update the state of the LEDs on the operator interface
Update_OI_LEDs(); // located in ifi_code.c
}

Here is the part before the error. Can someone help me ?

void Teleop(void) is in teleop.c
void Autonomous_Spin(void) where you said the error is located in autonomous.c

your error is going to be in your void Autonomous(void) function. Maybe forgot to close a Bracket or semicolons

Can someone check for me ?

void Autonomous(void)
{
/* Add your own autonomous code here. */

	/*Bob's Code starts*/
	/*  SCENARIO 1 ---- 
    step 1 grip keeper 
    step 2 raise arm
    step 3 drive forward 3 seconds full
    step 4 realease keeper and move backwards
    step 5 wait 
   */
// Autonomous_Code is determined by the position of the switch
//  rc_dig_in16 	switch on the robot rc AUTONOMOUS mode
//  rc_dig_in15 	switch on the robot rc AUTONOMOUS mode
//#define AUTO_MODE_DEFAULT		0  	// NO switch on the Robot at all
// AUTO_MODE_DEFAULT 		1	// if switch on rc_dig_in15
// AUTO_MODE_ARM 			2  	// if switch in the middle
// AUTO_MODE_DEFENSE 		3  	// if switch on rc_dig_in16

//#define AUTONOMOUS_GO_TO_Rack (  (int)rc_dig_in16 == 0)

/*set our default - no switch on bot */                                                                   
Autonomous_Code = AUTO_MODE_DEFAULT ;

Finney_auto_counter++;

// we need to find out if the switch is installed on the RC in Digital IN/OUT
// if so, then run the appropriate Autonomos code
if (   (!rc_dig_in15)  )
	Autonomous_Code = AUTO_MODE_DEFAULT ;  	// run code for position 15
else if (   (!rc_dig_in16)  )
	Autonomous_Code = AUTO_MODE_DEFENSE ;  	// run code for position 16
else if (   (rc_dig_in16) &&  (rc_dig_in15)  )	// run code for MIDDLE position
	Autonomous_Code = AUTO_MODE_ARM ;

if ( (rc_dig_in16) &&  (rc_dig_in15) ) // switch is in middle or missing	

{	// Going forward for three seconds.
	left_drive = left2_drive = 210;
	right_drive = right2_drive = 44;                                                                                                                                             
	if (Finney_auto_counter > 78) step++;
}
else if ( (!rc_dig_in16) || (!rc_dig_in15) ) // for position 15 or 16
{
 switch (step)
   {
	case 1:    
	/***** STEP 1 ******/
	 //grip keeper ring
	 //	claw_close = 1;
	 //  printf("auto step =%d 

", step);
if (Finney_auto_counter > 26) step++; //was 95
break;

	case 2: 
		/***** STEP 2 ******/
		// raise arm.
        // arm = 90;
	 	if (Finney_auto_counter > 78) step++;
		break;

	case 3: /***** STEP 3 ******/
		// drive forward.
		left_drive = left2_drive = 220; 
	       	 right_drive = right2_drive = 60;
	 	if (Finney_auto_counter > 95) step = 5;
		break;
	
	case 4: /***** STEP 4 ******/
		// release keeper and drive backwards 
		// claw_open = 1;
		//claw_close = 0;
		left_drive = left2_drive = 69; 
    		right_drive = right2_drive = 69;
	 	if (Finney_auto_counter > 380) step++;
		break;

	case 5:	/***** STEP 5 ******/
		// stop and wait.
		left_drive = left2_drive = 127; 
       	right_drive = right2_drive = 127;
	 	if (Finney_auto_counter > 131) step++;
		break;

	case 6: /***** STEP 6 ******/
	// look for the light and move towards it
	Process_Data_From_Master_uP();			
	if (Get_Tracking_State() == SEARCHING)
	{
		left_drive = left2_drive = right_drive = right2_drive = 127;
	}

//	This is so when it's not searching, it's moving towards the light
	else
	{
		// turn robot right toward the light
		if(PAN_SERVO < 124)
		{
		left_drive = left2_drive = 230;
		right_drive = right2_drive = 128;
		}
		// turn robot left toward the light
		else if(PAN_SERVO > 124)
		{
		left_drive = left2_drive = 128;
		right_drive = right2_drive = 76;
		}
		// drive robot straight toward the light until 5 feet in front
		else if((116/tan(180*(((TILT_SERVO-144)*25)/50)/3.1415)) > 5) // This converts the PWMs to radians and uses trig to find the distance
		{
		left_drive = left2_drive = 230;
		right_drive = right2_drive = 76; 
		}
	}

	default:
		left_drive = left2_drive = 127;
		right_drive = right2_drive = 127;
		// claw_close = 0;
		break;

}	 /* End of Switch ( Finney_auto_counter) */

	/*Bob's Code ends*/

}

I know this may be a pain, but try commenting out blocks of your code at a time. Comment out a huge block that fixes the problem, then make the block smaller and smaller until you find the line that causes the problem.