Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
zankich committed Feb 4, 2014
1 parent fc8ca57 commit 59120cb
Showing 1 changed file with 26 additions and 39 deletions.
65 changes: 26 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ func main() {
}

robot := gobot.Robot{
Connections: []gobot.Connection{ spheroAdaptor },
Devices: []gobot.Device{ sphero },
Connections: []gobot.Connection{spheroAdaptor},
Devices: []gobot.Device{sphero},
Work: work,
}

Expand All @@ -54,47 +54,34 @@ func main() {
package main

import (
"fmt"
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot-firmata"
"github.com/hybridgroup/gobot-gpio"
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot-firmata"
"github.com/hybridgroup/gobot-gpio"
)

func main() {

firmata := new(gobotFirmata.FirmataAdaptor)
firmata.Name = "firmata"
firmata.Port = "/dev/ttyACM0"

led := gobotGPIO.NewLed(firmata)
led.Name = "led"
led.Pin = "13"

connections := []gobot.Connection{
firmata,
}
devices := []gobot.Device{}{
led,
}

work := func() {
gobot.Every("1s", func() {
led.Toggle()
if led.IsOn() {
fmt.Println("On")
} else {
fmt.Println("Off")
}
})
}

robot := gobot.Robot{
Connections: connections,
Devices: devices,
Work: work,
}

robot.Start()
firmata := new(gobotFirmata.FirmataAdaptor)
firmata.Name = "firmata"
firmata.Port = "/dev/ttyACM0"

led := gobotGPIO.NewLed(firmata)
led.Name = "led"
led.Pin = "13"

work := func() {
gobot.Every("1s", func() {
led.Toggle()
})
}

robot := gobot.Robot{
Connections: []gobot.Connection{firmata},
Devices: []gobot.Device{led},
Work: work,
}

robot.Start()
}
```

Expand Down

0 comments on commit 59120cb

Please sign in to comment.