makeybutton: move pin config where it needs to be

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2022-07-27 21:22:58 +02:00
committed by Daniel Esteban
parent 1f54c7dd23
commit 71c77d4b53
2 changed files with 19 additions and 7 deletions
+2 -2
View File
@@ -15,8 +15,8 @@ var (
func main() {
led.Configure(machine.PinConfig{Mode: machine.PinOutput})
button.Configure(machine.PinConfig{Mode: machine.PinInputPullup})
key = makeybutton.NewButton(button)
key.Configure()
for {
switch key.Get() {
@@ -25,6 +25,6 @@ func main() {
case makeybutton.Released:
led.Low()
}
time.Sleep(30 * time.Millisecond)
time.Sleep(100 * time.Millisecond)
}
}