Skip to content

mrwormhole/gobadge

 
 

Repository files navigation

GoBadge

My custom conference badge powered by TinyGo on top of Adafruit hardware (EdgeBadge)

Important, in this fork, pressing "START" takes to main menu while "SELECT" directs to other apps. The main tinygo/gobadge repository uses the opposite.

MyCustomBadge

Compilation

  • Run this command to compile and flash

If you are running Mac or Linux, or have task installed you can run the following:

task flash

otherwise run tinygo directly

tinygo flash -target pybadge .
  • To display a conference logo on your badge:
task flash CONF=gcuk22
  • To customize the Gobadge with your own name and information, use the NAME, SLOGAN1, and SLOGAN2 variables like this:
task flash NAME="@TinyGolang" SLOGAN1="Go compiler" SLOGAN2="small places"

Custom Logo

  • Create an image with a 160x128 pixels size, copy it into cmd/assets folder.
    For the moment ONLY jpeg images are supported.
  • In cmd/main.go add the path to your file here
const (
    gcuk22Logo = "./cmd/assets/gopherconuk-2022.jpg"
    yourPathLogoHere = "./your/path/to/the/logo"
)
  • Add the corresponding flag to the conf map:
func confs() map[string]string {
	return map[string]string{
		"gcuk22"    : gopherconUK22Logo,
		"customLogo"  : yourPathLogoHere,
	}
}

Add a new target to the Taskfile:

go run cmd/main.go -conf=customLogo
tinygo flash -target pybadge .

You can run:

task flash CONF=customLogo

It will use cmd/logos/logo-template.txt to generate the image into a []color.RGBA. Then it is stored in variable in logo.go file.

package main

import "image/color"

var logoRGBA = []color.RGBA{ {255, 255, 255} }

After the image has been generated, the task command will flash it to the board.

About

Custom TinyGo powered badge 🔋

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%