mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-11 10:23:44 +00:00
makeybutton: move pin config where it needs to be
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
committed by
Daniel Esteban
parent
1f54c7dd23
commit
71c77d4b53
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user