It appears that I’m late to the party as I recently discovered Arduboy. I wish I learned of this neat little device while I was waiting for my PlayDate to arrive.
Anyway, I recently set up my development environment and I thought I’d share my workflow as well as issues I have run into. Since I don’t have a physical Arduboy yet I have been using the ProjectABE emulator. Although the emulator provides a code editor, I’d prefer to stick with my typical IDE, VS Code (especially as it supports a VIM plugin).
To work with VS Code, you need to install the Arduino extension provided by Microsoft. You then need to install the Arduino IDE. Unfortunately the extension does not yet support version 2.0 of the Arduino IDE so make sure you install a previous version. I wasted quite a bit of time trying to get this to work
In the Arduino IDE, make sure you install the recommended libraries like Arduboy2, see this guide. Unfortunately I was not able to create a board management configuration for Arduboy as
https://arduboy.github.io/board-support/package_arduboy_index.json appears to be dead. Nonetheless, this is not an issue. In the VS Code Arduino extension you’ll simply need to select the Leonardo board.
Now to configure your project in VS Code, make sure you have an
arduino.json at the root of your project. This file will contain your selected board, e.g.
"board": "arduino:avr:leonardo". This file also needs to contain an
output configuration, e.g.
"output" = "build". Otherwise, the VS Code extension will build to a
tmp directory and immediately remove it upon a successful build (odd default behavior).
Now for the workflow, you can create a build by running
Arduino: Verify. This will create a
.hex file in your configured output location. Finally you can run the file on the emulator with the command
~/ProjectABE/ProjectABE build/GameName.ino.hex. I tried to configure this command to run as a post build script through the Arduino VS Code extension but I was getting a screen error. I’m developing on a Chromebook so others may have better luck. On a side note, I wish the emulator remembered the window location as I have to resize it every time it’s launched.
And that’s it! Now I can develop on the emulator using my preferred IDE, VS Code, along with all of my plugins and great intellisense support.
(I would have provided more links above but I guess new users to this forum are limited to only 2)