- Go 96.4%
- Shell 2.3%
- Dockerfile 1.3%
| .claude | ||
| .vscode | ||
| cmd | ||
| docker | ||
| .gitignore | ||
| accel3d.go | ||
| accel3d_gopherbadge.go | ||
| accel3d_pybadge.go | ||
| adventure.go | ||
| adventure_map.md | ||
| badge.go | ||
| ble.go | ||
| ble_stub.go | ||
| data.go | ||
| defs_default.go | ||
| defs_gopherbadge.go | ||
| defs_nicebadge.go | ||
| defs_pybadge.go | ||
| docker-compose.badge.yml | ||
| Dockerfile | ||
| Dockerfile.server | ||
| game_colors.go | ||
| gameoflife.go | ||
| go.mod | ||
| go.sum | ||
| info.go | ||
| info_pybadge.go | ||
| leds.go | ||
| LICENSE | ||
| logo.bin | ||
| main.go | ||
| menu.go | ||
| messages.go | ||
| music.go | ||
| pacman.go | ||
| rand.go | ||
| README.md | ||
| reflex.go | ||
| schedule.go | ||
| snake.go | ||
| trajectory.go | ||
| trajectory_disabled.go | ||
badges
TinyGo badge firmware for multiple hardware targets (GopherBadge, NiceBadge, GoBadge/PyBadge).
Hardware targets
| Target | Build tag | Resolution |
|---|---|---|
| GopherBadge | gopher_badge |
320×240 |
| NiceBadge | nicenano |
240×135 |
| GoBadge / PyBadge | pybadge |
160×128 |
Menu options
The main menu lists the available modes for each hardware target. The options shown
depend on what is defined in menuOptions inside each defs_{board}.go file —
simply add or remove a constant from that slice to control which entries appear.
| Constant | Label | Description |
|---|---|---|
modeBadge |
Badge | Shows the personalised badge screen (name, titles, QR code, logo) |
modeInfo |
Info | Show QR for quick access to info and tutorials about the board |
modeSchedule |
GopherCon Schedule | Browse the conference schedule and mark favourite talks |
modeAdventure |
GopherCon Adventure | Text adventure set at the conference |
modeLEDs |
Rainbow LEDs | Neopixel LED animations |
modeAccelerometer |
Accelerometer | Live 3-axis accelerometer visualisation (hardware with LIS3DH only) |
modeMusic |
Music! | Play melodies via the buzzer |
modeGameSnake |
Snake | Classic snake game |
modeGameLife |
Game of Life | Conway's Game of Life simulation |
modeGameColors |
Color Game | Colour-matching reaction game |
modeGameReflex |
Reflex | Reaction-time tester |
modeGamePacman |
Pac-Man | Pac-Man arcade game |
modeEnterBootloader |
Enter Bootloader | Reboots into UF2 bootloader mode for flashing new firmware (NiceBadge only) |
modeTrajectory |
GTO Trajectory | Real-world GTO→lunar spacecraft trajectory simulation drawn pixel-by-pixel (NiceBadge only) |
Customising per board
Each board's defs_{board}.go file contains a menuOptions slice that controls
the order and visibility of menu entries:
// defs_nicebadge.go
var menuOptions = []int8{
modeBadge,
modeSchedule,
modeMusic,
modeGameSnake,
modeInfo,
modeEnterBootloader, // remove this line to hide the option
}
Entries not listed in menuOptions are simply not shown in the menu — no other
code changes are needed.
Generating logo.bin
The badge firmware embeds a logo.bin file displayed at boot (showLogoBin in badge.go).
Use the logogen command to convert any image to the required hex format.
Setup
cd cmd/logogen
go mod download
Usage
# By target name
go run . -size nicebadge -image tinygo
go run . -size gopherbadge -image gopherconeu
go run . -size gobadge -image golab
# By explicit resolution
go run . -size 320x240 -image /path/to/logo.jpg
# Write directly to the project root logo.bin
go run . -size nicebadge -image tinygo -output ../../logo.bin
Flags
| Flag | Default | Description |
|---|---|---|
-size |
(required) | Target name (nicebadge, gopherbadge, gobadge, pybadge) or explicit resolution (320x240) |
-image |
(required) | File path (relative or absolute) or short name |
-output |
logo.bin |
Output file |
-images-dir |
images |
Directory with source images |
-cache-dir |
cache |
Directory for cached .bin files |
Adding images
Place source images inside cmd/logogen/images/:
cmd/logogen/images/
tinygo.jpg ← source image for short name "tinygo"
tinygo_240x135.png ← predefined variant for nicebadge (skip resize)
tinygo_320x240.png ← predefined variant for gopherbadge (skip resize)
gopherconeu.jpg
golab.png
...
Resolution priority for a given short name + target:
<name>_<WxH>.png/.jpg— predefined resized variant, used as-is (no resize)<name>.png/.jpg/.jpeg— base image, resized with BiLinear interpolation- Cache hit (
cache/<name>_<WxH>.bin) — skips all image processing on repeat runs
Generated .bin files in cache/ are gitignored.