Julian Straub

creations and thoughts

Arduino with Vim

Posted at — Sep 27, 2020

Call me weird but one of my main gripes with Arduino was the UI. After having worked and coded with vim for over 5 years now, I feels like a regression to try and program in a UI that feels more like Microsoft Word. Hence, initially I resisted using Arduino at all and went back to using a Makefile with avr-gcc and avrdude. This works fine for small projects when its easy to code up everything from scratch. I think its fun and illuminating to know all your code from the ground up. This became problematic when I wanted to use a SSD1306 OLED display to display some values: I would have had to code all the I2C communication and rendering of characters up myself (not fun!). By switching to Arduino, I could leverage existing libraries like the no-fluff SSD1306Ascii library and be done with it in a couple of clicks of installing the library via the Arduino IDE.

Initially, I tried to use PlatformIO which uses VSCode and hence a proper code editor. It worked well and certainly had a good editor. It was pretty easy to try out mbed and other frameworks for STM32 micro controllers. But in the end it felt a bit opaque and overkill. It was also not easy to pull in other Arduino board definitions or libraries.

In the end I found a nice vim plugin (vim-arduino) that lets you pretty easily program any arduino supported board directly form vim. I can easily get new boards or libraries by using the Arduino IDE.