examples: small refactor to metal button example that shows how to use Gobot event channels
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
parent
589af6f44c
commit
da3adc0d85
|
@ -9,15 +9,15 @@ import (
|
|||
|
||||
func main() {
|
||||
e := edison.NewAdaptor()
|
||||
led := gpio.NewLedDriver(e, "13")
|
||||
button := gpio.NewButtonDriver(e, "5")
|
||||
|
||||
e.Connect()
|
||||
led.Start()
|
||||
button.Start()
|
||||
|
||||
led := gpio.NewLedDriver(e, "13")
|
||||
led.Start()
|
||||
led.Off()
|
||||
|
||||
button := gpio.NewButtonDriver(e, "5")
|
||||
button.Start()
|
||||
|
||||
buttonEvents := button.Subscribe()
|
||||
for {
|
||||
select {
|
||||
|
|
Loading…
Reference in New Issue