For better or for worse, I am an EMACS guy. It’s a good, comfortable fit, considering that EMACS stands for “editor for middle aged computer scientists”.
I also like a lot of Arduino compatible hardware, and leverage libraries and code posted by others to get things done – or at least started – faster.
The Arduino IDE has some nice little bits and pieces that I like:
- Easy management of support for lots of different boards
- Easy management and updating of libraries
- Quick access to serial monitor resistant to plugging/unplugging the board
- Lots of great code contributions that work well within the environment
I looked around for a way to develop Arduino code in EMACS, and there are a lot of possibilities, but they all required rather a lot of setup and maintenance and removed some of the advantages of the IDE mentioned above.
So, I came up with a low-tech solution. All of my “.ino” sketches look like this:
#include "src/main.h"
void setup() {
arduino_setup();
}
void loop() {
arduino_loop();
}
This is what src/main.h looks like:
void arduino_setup(void);
void arduino_loop(void);
Then, I just put all the code in main.cpp or include it from elsewhere in src/, and use the IDE only for compiling, loading and monitoring. All the steps for including exotic libraries or new boards, etc. are usually covered by the developers providing the code or libraries for the Arduino IDE environment, but I can live happily in EMACS most of the time.