Viewing Library Files (.h, .cpp)

Hey guys,

I've noticed that my Arduino IDE software (Vers 0022) won't open .cpp and .h files which I use as library files in my programs.

I have to first open them in Wordpad and then paste the info across to Arduino IDE to see if it compiles - and then if I make any amendments, I paste it back into Wordpad and save.

Is there any easier method?

Thanks heaps :).

-Andy

Libraries are typically developed in a sketch directory, and then copied to the libraries directory to be released/used.

It sounds like you are trying to develop in the libraries directory.

Is there any easier method?

Well, yes. The info above should be enough of a hint.

PaulS:
Libraries are typically developed in a sketch directory, and then copied to the libraries directory to be released/used.

More broadly, I would say this... The Arduino IDE is good for building sketches. If you want to develop libraries, open the files in another editor.

I often work on the libraries in place using another editor, and then build a sketch using it in the Arduino IDE. Works swell.

One of my favorite free programmign editors:

An actual programming editor is nice because it will do syntax hiliting, proper indentation and a bunch of other nice little things for you. If you have a CPP or an H file in your sketch, and you edit it while the sketch is open in the Arduino IDE, you will need to close the sketch in the Arduino IDE and reopen it, otherwise the Arduino IDE won't know the files have been edited.

Thanks for all the replies.

Skyjumper - CrimsonEditor looks good.. But it doesn't error check or compile Arduino or C files, right?

Hmm :slight_smile: Well, it's much better than nothing.

No an editor won't do that for you. What i have been doing to debug sections of my Arduino code is loading it into Open Watcom, which is an open source / free development system. Arduino code is standard C/C++ and uses the GCC compiler. Watcom includes a source line debugger and a profiler, which have been very handy. Of course its all intergrated nicely with an editor.

But, Watcom does not target AVR or Arduino. You can get the makefile to work and then compile from the command line without having to start the Arduino IDE. I'm working on getting that to work now. I saw a reference also to using GDB (the debugger) for AVR stuff but I have not investigated yet.

I suppose you could also use AVR Studio, which is a free download from Atmel, but i have not tried this.

The problem with all this is the Arduino special code and libraries.

Maybe you could use Eclipse, a popular open source IDE. Eclipse can launch make, and capture the errors that it produces, and maybe even identify the source line with the error.

Sorry I don't have a better solution for you. when I come up with one I'll post it, because I'm looking as well.

Actually, look here:

http://arduino.cc/playground/Main/DevelopmentTools