No description
Find a file
2026-04-21 22:20:43 +02:00
cmd/logogen added images for logo, minor fixes 2026-04-21 22:18:18 +02:00
.gitignore added cmd to generate logo images 2026-04-18 12:19:58 +02:00
accel3d.go almost everything working for nicebadge 2026-04-17 18:43:42 +02:00
accel3d_gopherbadge.go almost everything working for nicebadge 2026-04-17 18:43:42 +02:00
accel3d_pybadge.go added files 2026-04-14 19:21:59 +02:00
adventure.go added images for logo, minor fixes 2026-04-21 22:18:18 +02:00
badge.go added images for logo, minor fixes 2026-04-21 22:18:18 +02:00
data.go change URL for QR 2026-04-21 22:20:43 +02:00
defs_default.go almost everything working for nicebadge 2026-04-17 18:43:42 +02:00
defs_gopherbadge.go changes 2026-04-21 21:51:05 +02:00
defs_nicebadge.go changes 2026-04-21 21:51:05 +02:00
defs_pybadge.go changes 2026-04-21 21:51:05 +02:00
game_colors.go almost everything working for nicebadge 2026-04-17 18:43:42 +02:00
gameoflife.go almost everything working for nicebadge 2026-04-17 18:43:42 +02:00
go.mod fix 2026-04-21 21:48:28 +02:00
go.sum almost everything working for nicebadge 2026-04-17 18:43:42 +02:00
info.go almost everything working for nicebadge 2026-04-17 18:43:42 +02:00
info_pybadge.go fixes 2026-04-15 23:18:25 +02:00
leds.go almost everything working for nicebadge 2026-04-17 18:43:42 +02:00
LICENSE Initial commit 2026-04-14 17:20:45 +00:00
logo.bin added images for logo, minor fixes 2026-04-21 22:18:18 +02:00
main.go added images for logo, minor fixes 2026-04-21 22:18:18 +02:00
menu.go changes 2026-04-21 21:51:05 +02:00
music.go added files 2026-04-14 19:21:59 +02:00
pacman.go changes 2026-04-21 21:51:05 +02:00
rand.go added files 2026-04-14 19:21:59 +02:00
README.md added cmd to generate logo images 2026-04-18 12:19:58 +02:00
reflex.go changes 2026-04-21 21:51:05 +02:00
schedule.go added files 2026-04-14 19:21:59 +02:00
snake.go almost everything working for nicebadge 2026-04-17 18:43:42 +02:00

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:

  1. <name>_<WxH>.png / .jpg — predefined resized variant, used as-is (no resize)
  2. <name>.png / .jpg / .jpeg — base image, resized with BiLinear interpolation
  3. Cache hit (cache/<name>_<WxH>.bin) — skips all image processing on repeat runs

Generated .bin files in cache/ are gitignored.