How to distribute a game to the dev community w/ a Hex file

There are a number of ways to share your game in progress, but perhaps you want to make sure that the recipient is loading exactly what you are loading onto your Blinks. If you are keeping up to date with our developer branch of the Blink Lib, there are lots of changes happening quickly, so letting someone download your source and compile it in the Arduino IDE might result in your game compiling against a different BlinkOS. Here is a quick way to archive your game as a hex file from the Arduino IDE.

Once you have written your game/sketch/interactive art piece, instead of Upload Using Programmer, as usually would do (same as clicking the :arrow_right:), this time you select Export compiled Binary. This will compile your sketch and create a file in your sketch’s folder (name_of_your_sketch.hex).


You can now add this to github with a release, or zip it to email friends or upload a link to the forum. The world is your oyster!..

But wait, how do we get this .hex file onto the Blinks?

Great question. Open up Terminal (if you are on a mac, and shell if you are on a pc… any command line will do). When you installed Arduino, you also got a toolkit called AVRDude, which is what uploads the firmware. We can use this tool directly from the command line and it only requires typing one line.

avrdude -p m168pb -P usb -c usbtiny -U flash:w:name-of-file.hex

The results will look like this

1 Like