Use MPLAB to program your VEX robot -- FOR FREE!!

I made this really nice tutorial that will show you how to program your vex bot with MPLAB. You can download it from here.

Thanks for the tutorial, I was getting tired of using EasyC and this also helped me get MPLAB up and running properly.

Not a problem.

I’ve actually just gotten a chance to load the hex file onto a controller and it seems that it doesn’t run once loaded. I put a PrintToScreen at the beginning of main and when I turned on the controller while it was tethered, I got nothing. To make sure it wasn’t a problem with the way I was transferring the hex file I compiled the same thing in EasyC and loaded it onto the controller, which proved to work fine.

Can you think of anything that could be the problem? I followed the tutorial exactly and I get one warning in the compilation output about calling Tank4 before it was prototyped, but asides from that everything seems to be fine.

Oh and I’m using MPLAB v8.10 with MCC18 v2.4 if that helps.

That is really weird. I will look into it, and get back to you later today.

Aaron,

Make sure that you have the correct linker/.h/.lib files. That is the only think that I can think of unless your code is incorrect. Why don’t you post it just so to make sure. I’ll do my best. :slight_smile:

Before I post the code I’ve been working on (which was loaded onto the robot initially) I’m going to try and load just a simple PrintToScreen in the main function to see if it was my code. However, I can only do that tomorrow as that’s when I get to go into my school and toy around with it.

I’ll let you know anything I find out, thanks for your time.

It turns out the controller I had loaded the code onto was broken in some way, but it’s fixed now (after loading the default FRC code, then the Default Vex code). I loaded my new program onto it and it worked perfectly, thanks.

GGCo i have downloaded the files etc from your tutorial
but get an erro message of not finding stdio.h
?? if yoiu can help that would be great
thanks john

PrintToScreen should only work in EasyC, as far as I know. For the IFI Loader terminal window, use printf(). Cast the string with (const char *), as follows:

printf((const char *)"Hello, world.\r");

EasyC uses the WPILIB… That is what GGCO’s Document is all about…

Here is my Follow Up Post on how to fix that issue, Re: Use MPLAB to program your VEX robot – FOR FREE!! (Post #18).

I know this is talking about WPILib, that’s what I used in MPLAB (well, an MPLAB clone, anyway) for a while before switching to default code. I was under the impression that PrintToScreen only worked with the EasyC reader, not with IFI Loader, because it sends more data than IFI Loader is looking for (specific line numbers, line resets, etc.). I’ve always used printf() and it works. But you can use PrintToScreen?

hello GGCO ,

i used your tutorial ( he is great ) but i’m getting one eror :

he goes like this :

Eror: coff file format for ‘. main.o’ is out of date

link step failed

i hope you can help me with that …

thank ,

eagal.

That means your compiler version doesn’t match the libraries you are using. The libraries were compiled with one version of the compiler and your program is being compiled with a significantly different version.

The COFF format changed when the compiler went from version 2.x to version 3.x.

Figure out what version of the compiler you’re using and you can get the matching support libraries.

P.S.
Kevin Watson’s site has basic libraries for both the 2.x and 3.x compiler versions.