Go experiments for the Raspberry Pi RP2040 MCU using TinyGo. This repo includes:
See the full write-up of using the RP2040 and Go on macOS.
- Install Go
- Install TinyGo
- Clone the repo.
- Switch to a project directory, eg.
cd path/to/repo/wumpus
. - Run
go mod tidy
to get dependencies. - Connect your Raspberry Pi Pico.
- Run
tinygo flash -target pico
to build and install the application.
A sample project to build a fun game.
- An HT16K33-based 8x8 LED matrix; I used this display.
- A piezo speaker.
- One small button.
- A two-way, self-centring analog joystick; there are lots available on eBay.
- A red LED.
- A green LED.
- Wires.
- Two standard breadboards.
- Make sure you wire the LEDs correctly: longer leg to the Pico pin, shorter leg to GND.
- The joystick shown is not the one used, but it gives you the idea. Connect white to the X pin, blue to the Y pin.
This is a fun little game to hunt the Wumpus. Move through the cave with the joystick.
A red light indicates a nearby pit — if you fall in, you’ll be killed.
A twittering sound indicates a nearby bat. If you enter its square, it will carry you to another part of the cave.
A green light indicates the Wumpus is close. Enter its square and it will eat you, but if you’re sure where it is, press the button to fire an arrow to kill it first. To fire the arrow successfully, back off and then move toward the Wumpus in the direction you want to the arrow to fly. If you miss, the beast will catch you!
- 1.0.4
- Fix: respect requested display brightness.
- 1.0.3
- Code tidy — no functional changes.
- 1.0.2
- Add missing bat animation frame.
- 1.0.1
- Add post game report/
- Bug fixes, ie. missing animations.
- 1.0.0
- Initial release.
This version was based on a C port of an Arduino version created by Corey Faure. This is very much his game, but I have taken a few liberties with a couple of the animations and rewritten the code.
All source code released under the MIT Licence. Copyright © 2024, Tony Smith (@smittytone).