Created
June 10, 2022 11:10
-
-
Save deadprogram/4e55c3d0e663295839dd66f6517d8aa4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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