Arduboy Nano Clone

01/08/20

Last modified on 01/08/20

Categories: Microcontrollers Gaming Projects Tags: Arduboy Arduino

~/contents

Dusting off the Nanos

It’s been a while! I thought this might be a good way to refresh my mind on Arduino. The official Arduboy uses the same chip as the Arduino Micro, but several users have been able to cobble together Arduino Nano clones to test out the libraries.

I hooked up my devboard and FTDI cable and uploaded a basic blink sketch to make sure everything was working. In the past I had trouble with the USBs on my Nanos so we’ll just bypass that altogether now and use an FTDI connection. I then updated the Arduino IDE. There was a change made to the official Arduino Nano boards in 2018 and some older boards must use ATMega329P (Old Bootloader). EunChan Park’s video, Solution Why Arduino Nano NOT Uploaded (2019) explains. I find I can only upload scripts with the new Bootloader.

Schematic

harbaum’s SLIMBOY schematic:

arduboy breadboard schematic

Setting up Arduboy2

The Arduboy Quickstart Guide recommends installing all Arduboy-related libraries:

In the Arduino IDE, select:
Sketch > Include Library > Manage Libraries…

Since we are using harbaum’s Arduboy2 library we will need to get it directly from GitHub and add the library manually (check Documents/Arduino/libraries/)

The official Arduboy uses an Arduino Micro, and the board type for uploads is the Arduino Leonardo. However, we are using the Nano, and in Tech Maker’s Arduboy Nano video tutorial they set board as Arduino Nano. (They use the old bootloader but, again, my boards use the new one. Test a basic sketch to see which you need.)
Tools > Board: “Arduino Nano”

The Arduboy2 library has several example sketches.
File> Example > Arduboy2 > Buttons

I remind myself with Nanos you must hit the reset button when uploading (not compiling). The button sketch allowed me to test buttons and I saw two were miswired (wheee). I tried Ardubreakout next and it worked like a charm.

arduboy clone playing ardubreakout

Games

One of the reason I’m interested in the Arduboy is I can program my own games and tweak existing ones. That means I can make a game like Ardubreakout 5-year-old friendly with a larger, slower ball, for example. harbaum has tested several games, including Shadow-Runner, VIRUS-LQP-79, Pinball, and Nineteen43.

There are hundreds of Arduboy games and the directory has a browser emulator which is amazing and THANK YOU SO MUCH. There is also Erwin’s Arduboy Collection. I found several games I thought would be a good fit for Minnow. I haven’t tried them all yet.

Migrating Arduboy sketches to Arduboy2

On a whim I decided to try CDRXavier’s PONG and found I could not compile it. Following the Arduboy2 guidelines for migrating sketches, I updated the library includes and switched to the ArduboyTones library and had no trouble getting PONG to run on my Nano.

Now What?

Well, this was a fun test for sure, but the breadboard setup is not going to cut it. The official Arduboy comes in a credit-card sized case and runs on a 180 mAh Thin-Film Lithium Polymer rechargeable battery which is good for up to 8 hours. Currently, it only holds 1 game at a time because it has no external storage. This is not necessarily a problem, however, little kids can be overwhelmed with choices. I am less concerned with memory limits and battery power than I am with form factor.

I made a devboard, but there’s room for improvement. I’d like to do is incorporate a joystick. The button pinout is defined in Arduboy2Core.h and uXe suggests the replacement code for buttonsState(). filmote’s Don’t like the default behaviour? Extend and overwrite it! explains how to override Arduboy2 source library code. I’m also looking at a 2.42” screen and flash storage.

arduboy devboard

https://github.com/harbaum/Arduboy2
https://create.arduino.cc/projecthub/mircemk/arduboy-clone-with-arduino-nano-and-i2c-oled-display-7cdaad
https://www.reddit.com/r/arduino/comments/b58bo1/arduboy_clone_on_a_breadboard_with_arduino_nano/
https://community.arduboy.com/t/arduboy-on-arduino-nano-i-c-display/5532
https://community.arduboy.com/t/hendras-arduboy-clone/5927/2
https://www.instructables.com/id/Ardubaby-Mini-Game-Console-With-500-Games/
https://www.youtube.com/watch?v=v8KRtKZA7nE
https://learn.adafruit.com/arduboy-game-controller
https://www.tindie.com/products/Ampersand/peanut-kit/
https://community.arduboy.com/t/homemade-arduboy-based-on-itsybitsy-formerly-leonardo/5503/23
https://www.youtube.com/watch?v=je5CKsIrNw8
https://arduboy.ried.cl/