Digistump and Arduino

Say that you have a passion for retro computing. Let's add that you have fond memories of when you were playing Amigas, a lovely clone of Arkanoid, on Commodore Amiga.
Nostalgia Troy on Twitter: "VS post for today is between the ...

You fire up either FS-UAE launcher or even turning on a real amiga. Boot the game and after a few frustrating attempts, you realize that there's no way to play that game either with keyboard or a joystick.

You need a dial joystick. They are also called spinners or rotary and ten other slags around the globe but the formal name is Paddle.

Amazon.com: R-STYLE USB Paddle Controller Suitable for Arkanoid or ...

Now, that is the time where you are thinking. OH! I can build one and I can use Arduino. That's when sanity walks back in your brain room, slaps you in the face, and tells you, how about a DigiStump??


Because they are cheaper, much smaller. And most important you are not using a cannon to kill a fly that has not spent some quality time with Godzilla!

If you have never used DigiStump hardware before this post will take you through the first baby step and in future posts, we will be building our cheap edition of a Paddle that works for Amiga.

Grab a board, the cheapest will be fine. Again you could do this with Arduino or a Teensy or a Things but it would way overkill because all you are actually doing is to simulate the mouse movement the difference that you only send in X values with the precision of a nipple rubbing rather than the forceful movement of a bull in a China shop.

Configuration

Step one is to download the Arduino IDE and make the following changes:
Go to preferences and add the following address to allow the discovery of not built-in library support.
http://digistump.com/package_digistump_index.json

now you will have the ability to download from the contribs libraries that you need. Which is: Digistump AVR Boards

After you have installed the library you have two mandatory steps in order to deploy code.
  1. Select the board from boards list (Digispark 16.5 will do it)
  2. Select the micronucleus from the bootloader list
and lastly, to actually make it work on macOS 64bit, you will have to do:
$ cd ~/Library/Arduino15/packages/arduino/tools/avr-gcc
$ mv 4.8.1-arduino5 orig.4.8.1
$ ln -s /Applications/Arduino.app/Contents/Java/hardware/tools/avr 4.8.1-arduino5
Otherwise, you will be receiving a bad CPU exception even for the most basic of the scripts.

To deploy code to the little evil, you will need to push the deploy button on the IDE and wait to see the message to plug it in otherwise the IDE won't sense that is already attached. The Digistump has plenty of limitations compared to a fully-fledged Arduino board/clone but basic keyword/mouse emulation is more than any Chinese toy factory would use. And despite of all the bias around what comes from China, toys survive to kids enduring! So you will be good too, including the kid in you.

Shopping List

Now that you have an idea of how to program the board, our next objective is to assemble the real thing. I have no clue yet (exactly) but we will figure it out between a beer and a few shouting to the wall. For our next time, here is what you will need.
  1. Head spinner
  2. Rotary encoder
  3. Digistump (cheapest best)
  4. Maybe some resistors since they are like the slaughtered pig, nothing goes to waste
  5. An enclosure of some kind (I will build something to 3D print)
Happy deploying

Comments

Popular posts from this blog

Postgres on Synology

Zen-inification - The art of decluttering

Bring Boxee Box back to life