Skip to content

Instantly share code, notes, and snippets.

@deadprogram
Created June 10, 2022 11:10
Show Gist options
  • Save deadprogram/4e55c3d0e663295839dd66f6517d8aa4 to your computer and use it in GitHub Desktop.
Save deadprogram/4e55c3d0e663295839dd66f6517d8aa4 to your computer and use it in GitHub Desktop.
package main
import (
"machine"
"machine/usb/hid"
"machine/usb/hid/keyboard"
"time"
)
func main() {
button := machine.BUTTON
button.Configure(machine.PinConfig{Mode: machine.PinInputPullup})
kb := keyboard.NewKeyboard()
hid.Enable(kb)
for {
if !button.Get() {
kb.Write([]byte("tinygo"))
time.Sleep(200 * time.Millisecond)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment