From da3adc0d854a2358a880d0076a33129c0ced01b1 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Tue, 18 Oct 2016 11:31:40 +0200 Subject: [PATCH] examples: small refactor to metal button example that shows how to use Gobot event channels Signed-off-by: deadprogram --- examples/metal_button.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/metal_button.go b/examples/metal_button.go index ecfe63be..4cc9ee6c 100644 --- a/examples/metal_button.go +++ b/examples/metal_button.go @@ -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 {