1

Situation:

Mac OS, Arduino IDE 1.5.6r2

I've got a sketch with several files, all classic .cpp and .h source and header files except the main sketch file. As the project goes more complex I started to generate code automatically by another program. Now I have hard times integrating the generated code it into my sketch. The arduino IDE seems to load the code on opening the sketch. After that, the source files aren't beeing checked for external changes by the IDE (as I would expect it from a real editor like vim). On top of that, when I verify my code the IDE seems to save the files from RAM into a temporary build directory ignoring the contents of the sketch directory further. So if I let my code generator change a source file while the sketch is opened in the IDE, the changes won't reach the build. I had to close the IDE and reopen it. The next thing I tried is to include my autogenerated file from an existing and opened code file inside the IDE. But the IDE ignores files, which aren't opened completely. Hence, the file is missing in the build directory.

Is there a trick to let the IDE take the code unknown to itself along into the build directory? Or how else can I deal with this situation? I don't want to close and open the IDE a hundred times a day.

  • 5
    Select "Use external editor" in the preferences. Not ideal, but it might work for you. – Gerben Jan 30 '15 at 22:02
  • 1
    This works. When verifying the sketch, the IDE now checks the content of the directory for new and changed files. The drawback is, I have to switch over to an editor. Probably I'm going to use vim. – Ariser Feb 1 '15 at 13:09
2

According to the release notes starting with V1.5.2 of the IDE you can verify and upload from the command line.

You could use your favorite editor and then use the command line to do the arduino build/upload instead of the IDE.

See: https://github.com/arduino/Arduino/blob/ide-1.5.x/build/shared/manpage.adoc

I have not used it so I can't say if it work well or not.

  • Ok, I tried and used it. The outcome seems to be ok. I still have to think about using that method on a regular base. It is not the most comfortable way to get things done, but nothing really uncanny. Perhaps I can even do some integrative scripting around it. Thanks a lot. – Ariser Feb 3 '15 at 21:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.