Skip to main content

Playing with the Arduboy and Editing Sketches

top1_d29a2a1ab3ca2dfd51c93a39070f6750f8699d7d.jpg

Taking a look at the programmable miniature game system and its classic 8-bit games.

As the name suggests, the Arduboy (174-3299) is a Game Boy inspired miniature game console with an Arduino at its heart. At around 55mm x 85mm x 5mm it’s about the size of a credit card and is designed to play 8-bit retro style console games.

As it is programmable and open source, you can develop and upload your own games or use one of the hundreds — or possibly even thousands — developed by a thriving community of Arduboy game developers.

The Arduboy crams the following into its tiny form:

  • 1-bit 128x64 pixel OLED matrix display
  • 8-bit ATmega32u4 Microcontroller
  • 32KB Flash, 2.5KB RAM, 1KB EEPROM
  • 6 Hour 180mAh lithium-polymer battery
  • Arduino compatible
  • USB recharge and reprogram
  • 6x soft click buttons
  • RGB LED and piezo speaker

Sadly it does NOT have a hidden built in WiFi function – that was an April Fool!

Loading games

IDE_library_manager_c414e127966ba4d297bde387b507333f001b108c.png

As the Arduboy is Arduino Leonardo-based, code — in the form of sketches — can be written, edited and uploaded to it using the Arduino IDE. Before you can do this you need to install the following Libraries via the Tools / Manage libraries menu:

  • Arduboy
  • Arduboy2
  • ArduboyTones
  • ArduboyPlaytune
  • ArdBitmap
  • ArdVoice
  • ATMlib
  • Arduboy-TinyFont

I found all these by simply searching for Arduboy in the IDE library manager.

I connected the Arduboy to my PC using the provided Micro-USB cable and then turned it on. I selected the Arduino Leonardo board type in the Tools / Board menu of IDE, and then selected the correct Port number and you are ready to upload a game of your choice.

I did an Internet search for Arduboy games and was a bit overwhelmed with the amount out there. The official Arduboy web site has hundreds and a search for Arduboy on Github shows over 800 repositories. Many of these are pre-compiled and so, instead of using the Arduino IDE, they come in the form of .hex files that are uploaded to the Arduboy with an Uploader that, once downloaded was straightforward ton install on my Windows PC. I chose to associate the Uploader with .hex files as I was installing it. This meant that, when the Arduboy was plugged into my PC and turned on, I just double-clicked a file and it uploaded it.

There is also an Android app that lets you load pre-compiled games from your ‘phone. I didn’t try this as I do not have a suitable cable, but reports suggest it works well.

I am more of a puzzle person than a gamer and there were plenty of the classic board games and puzzles for me to chose from. The size and resolution of the screen obviously places some restrictions on what works – I tried a solitaire card game, but my eyesight was not up to differentiate between the suites. After I had tried Pipes, Reversi and Othello, a couple of Synthesiser and Sequencer apps caught my attention.

I hit a slight problem after loading one of the synth programs that was particularly big, only just fitting in the Arduboy’s memory. I then found I could not upload anything else. A quick Internet search provided a solution, which was to unplug the Arduboy from my PC and then put it in Flashlight mode by turning it off and then turning back on while holding the up button. Re-connecting it to my computer and I could now successfully upload a new game.

Editing an Arduboy sketch

arduboy_887f4c26980349565502b63af5839446fa547847.jpg

The FM Synthesiser program I was experimenting with does allow you to edit the notes it plays with the buttons on the Arduboy, but I thought I would have a go at editing the sketch so that at least the default tune it played on starting up was not Twinkle Twinkle Little Star.

I found the lines of code in the main section of the sketch that defined the notes that were being played:

const int8_t song01[SEQ_LEN] PROGMEM =

{

M_C5, M_C5, M_G5, M_G5,

M_A5, M_A5, M_G5, M_TIE,

M_F5, M_F5, M_E5, M_E5,

M_D5, M_D5, M_C5, M_TIE

};


I edited them to a rough approximation of Brian Eno’s synthesiser solo in Roxy Music’s “Virginia Plain”.

const int8_t song01[SEQ_LEN] PROGMEM =

{

M_TIE, M_C5, M_C5, M_C6, M_C5,

M_C5, M_C6, M_C5, M_C5,

M_F5, M_TIE, M_TIE, M_TIE,

M_TIE, M_TIE, M_TIE,

};

All I need to do now is the hack that lets you take audio out of the Arduboy’s USB socket – although it looks a little invasive! I could then corporate the Arduboy into my synthesiser set up.

The Arduboy is a fun little gadget and a good way to get into coding, especially if you are interested in gaming. There are comprehensive tutorials detailing how to write your own games and the synthesiser game I have been playing with shows you can squeeze a lot into its tiny form factor.

I have a background in the arts, environmental conservation and IT support. In my spare time I do a bit of DJing and I like making things.