Fix broken examples

This commit is contained in:
Adrian Zankich 2014-06-06 13:18:07 -07:00
parent 30b92ac39f
commit 6f14570641
6 changed files with 8 additions and 7 deletions

View File

@ -16,7 +16,7 @@ func main() {
brightness := uint8(0)
fade_amount := uint8(5)
gobot.Every(0.1*time.Second, func() {
gobot.Every(100*time.Millisecond, func() {
led.Brightness(brightness)
brightness = brightness + fade_amount
if brightness == 0 || brightness == 255 {

View File

@ -3,8 +3,8 @@ package main
import (
"fmt"
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/gpio"
"github.com/hybridgroup/gobot/platforms/firmata"
"github.com/hybridgroup/gobot/platforms/gpio"
"github.com/hybridgroup/gobot/platforms/leap"
"time"
)

View File

@ -45,8 +45,8 @@ func main() {
})
}
gbot.Robots := append(gbot.Robots,
gobot.NewRobot("brainBot",[]gobot.Connection{adaptor},[]gobot.Device{neuro},work))
gbot.Robots = append(gbot.Robots,
gobot.NewRobot("brainBot", []gobot.Connection{adaptor}, []gobot.Device{neuro}, work))
gbot.Start()
}

View File

@ -21,5 +21,5 @@ func main() {
gbot.Robots = append(gbot.Robots,
gobot.NewRobot("cameraBot", []gobot.Connection{}, []gobot.Device{window, camera}, work))
gbot.Start()}
gbot.Start()
}

3
examples/sphero_api.go Normal file → Executable file
View File

@ -6,7 +6,7 @@ import (
"github.com/hybridgroup/gobot/platforms/sphero"
)
Master := gobot.NewGobot()
var Master gobot.Gobot
func TurnBlue(params map[string]interface{}) bool {
spheroDriver := Master.FindRobotDevice(params["robotname"].(string), "sphero")
@ -15,6 +15,7 @@ func TurnBlue(params map[string]interface{}) bool {
}
func main() {
Master = gobot.NewGobot()
api.Api(Master).Start()
spheros := map[string]string{

2
examples/sphero_master.go Normal file → Executable file
View File

@ -27,7 +27,7 @@ func main() {
}
master.Robots = append(master.Robots, gobot.NewRobot(
""
"",
nil,
nil,
func() {