chipKIT® Development Platform

Inspired by Arduino™

LED Library for ChipKIT MAX32

Created Sun, 17 Nov 2013 00:21:15 +0000 by Endevor


Sun, 17 Nov 2013 00:21:15 +0000

I just upped to a MAX32 from an Arduino Mega and was hoping for a fairly easy transfer of code from the mega to the max. I'm using the following libraries that aren't in the chipkit's original arsenal, from the Arduino site in order to control a lighting system for an aquarium.

Time - [url][/url] DS1307RTC - [url][/url] LED - [url][/url]

But I'm getting an error whenever I try to use them, specifically the LED, though other examples are giving the same error:

In file included from sketch_nov16a.cpp:1:0:
C:\Users\Jonathan\Desktop\mpide-0023-windows-20130715\mpide-0023-windows-20130715\.\hardware\pic32\libraries\LED/Animation.h:22:21: fatal error: cppfix.h: No such file or directory
compilation terminated.

So apparently it doesn't like cppfix.h or doesn't know where it is? Is there a fix for this or even an alternative library or do I need to build my own library?



Sun, 17 Nov 2013 08:57:10 +0000

I use this version of the jeelabs RTClib from Adafruit. It works fine for me.

The LED Library I have never tried so can not help there, maybe others could, but the first thing I always try if I get an error like that is to comment out the lines that call the offending header. Often it is somthing Hardware specific to the AVR that is not needed in the PIC32.

Cheers Chris


Sun, 17 Nov 2013 18:47:29 +0000

So I figured out the problem, and it's actually pretty simple.

Within the library, there's a folder called cppfix which holds that code. In the Arduino IDE, it can find it, but for whatever reason it won't with the ChipKIT IDE. So, the simple fix is to pull out the code files and move them into the same folder as the rest of the libraries.

So if anyone else wants to use this library, it's great for dimming LEDs as a thread. You'll just have to move the cppfix files into the right directory.

Thanks for the help, the other libraries actually seem to be working properly.


Sun, 17 Nov 2013 19:01:54 +0000

The standard library format stipulates that extra code like that should go in the "utility" folder. Anywhere else, and it won't be found. They must have broken that requirement in a later version of the Arduino IDE.


Sun, 17 Nov 2013 19:13:50 +0000

I do believe cppfix is a new addition to Arduino v1.0. I've seen a lot of newer libraries referencing it to it lately. I'll have to compare directories when I get the chance.


Sun, 17 Nov 2013 19:23:49 +0000

The only references I can find to cppfix involve a cppfix.h which implement new and delete for the Arduino - something not needed for the chipKIT - it already (I believe) has new and delete.

I see nothing about a cppfix folder except maybe included in libraries for users that need to add it to their system if they don't already have it...?