Default Code error?

I loaded the new 08 default code to the robot, but it won’t respond to the controllers and it will not respond when I give it a value of 255.

I read kevins post about upgrading the software to use the new code, but that just helped me to beable to load it to the bot.
I also noticed he removed the printf code.

how did other teams get their bot going?
and can someone tell me if I can add printf and how?

I just tried to program autonomys and I found that I am able to control the pwm(s) with static statements such as:
pwm=255

in teleop.c, call:

Default_Routine();

that should set pwm01 to p1_y, pwm02 to p2_y, etc.
You can edit the function in ifi_code.c
Look in the forum for help for beginning programming, there are several threads in existence already

Printfs can be used in the code, just need to remember to end lines with
to make sure you get a new line.

Thanks for the reply,but does it matter where I put it?
I tried adding that code but I get an error

“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-
Thread would not exit normally.
Could not read language tool output from pipe. (5)
A language-plugin exception occurred and was logged.
BUILD FAILED: Sat Feb 02 12:55:39 2008”

there are threads which tell you how to solve that. Use the search function to find them

Yeah thats what I have been doing for a few hours now.
I looked under beginning programming I can’t find anything.
What else should I search for, cause I don’t even know what to call my problem?

As far as I know there’s been maybe one thread about this… And it wasn’t really resolved. At least I haven’t heard of this before.

Anyway, what version of mcc18 are you using? The build commands are a bit weird, (the disabling of the removement of unreachable code, and all the other minuses), but it doesn’t look like that is causing an issue. Does this error still occur even without a printf? As this looks like a compiler issue.

And by default code, do you mean the FIRST default code or Kevin Watson’s code?

I am using mcp18V 3.10 I think ( I read a post by kevin saying we needed to use it)

the default I am refering to is from kevin.
where can I get the FIRST default code? isn’t it the same as kevins?

I commented out all printf because it didn’t work and I just wanted to get the bot moving.

Where did you get 2008 default code? I looked on ifirobotics.com and couldn’t find anything newer than 2007. I also looked on kevin.org and didn’t see anything there that looked like '08 default code.

kevin.org/frc/

http://www.kevin.org/frc/ifi_frc_simple.zip

is there something else I should be using?

There really isn’t a 2008 default code, so I suppose ‘default’ would be 2007’s default code. The real difference is that it’s only compatible with the 2.4 version, thus the topic title of the sticky. (Sorry, I’m not the most knowledgeable about the compiler…)

That looks right for Kevin’s sensorless code, there are version available with the gyro and stuff, if you want it.

would you recomend sticking with the 07 code?

I don’t think you should abandon Kevin’s code yet, it really is very handy. However, bulky code that works is better than elegant code that doesn’t. I’d save this as a last attempt.

What version of MPLAB are you using? There might a problem there, try reinstalling with 8.0+ or something. (I don’t know MPLAB well either, just a thought.) And looking at the build stuff again… Do you have the include search path at C:\mcc18-3.10\h or similar? That’s set by right clicking the project, (.mcp), selecting Build Options and using the Directories tab.

This is a very strange error. Are you using Windows? What version of MPLAB are you using (not C18, which is different)?

-Kevin

We added mcc 18 to the search path and it still did not work. Also we are using MPLAB 8 with Windows.

So this compiles correctly without printfs? Or has it never worked correctly? If it has been built successfully at some point, what edit exactly caused the error?

WE FIXED IT!!!

Thanks everyone for your help.
We didn’t know where to put the Default_Routines(); but as you will see we found it was already there and in the right place.

If this is happening to anyone else here is what we did:

  1. in MPLAB under build options we have:

-set our output directory
-include in search path= “c:\mcc18\h”
-Library searchpath =“c:\mcc18\lib”
-linker skript=“c:\mc18\lkr”

  1. in Kevins code in the file “teleop.c”

Make sure to find where it says:
**void Teleop(void)
{
// enable this to use IFI’s default robot code
//Default_Routine(); // located in ifi_code.c

// update the state of the LEDs on the operator interface
Update_OI_LEDs();		// located in ifi_code.c

}**

and uncomment Default_Routine();

Thats all we had to do to get it to run the driving code.