Skip to content

smittytone/pi-pico-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pi-pico-go

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.

Projects

Installation

  • 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.

Hunt the Wumpus

A sample project to build a fun game.

Requirements

The circuit

Hunt the Wumpus circuit layout

  • 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.

The Game

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!

Release Notes

  • 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.

Credits

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).

About

Go experiments for the Raspberry Pi RP2040 MCU

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages