No description
| cmd/logogen | ||
| .gitignore | ||
| accel3d.go | ||
| accel3d_gopherbadge.go | ||
| accel3d_pybadge.go | ||
| adventure.go | ||
| badge.go | ||
| data.go | ||
| defs_default.go | ||
| defs_gopherbadge.go | ||
| defs_nicebadge.go | ||
| defs_pybadge.go | ||
| game_colors.go | ||
| gameoflife.go | ||
| go.mod | ||
| go.sum | ||
| info.go | ||
| info_pybadge.go | ||
| leds.go | ||
| LICENSE | ||
| logo.bin | ||
| main.go | ||
| menu.go | ||
| music.go | ||
| pacman.go | ||
| rand.go | ||
| README.md | ||
| reflex.go | ||
| schedule.go | ||
| snake.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 |
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.