Fix broken examples
This commit is contained in:
parent
30b92ac39f
commit
6f14570641
|
@ -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 {
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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{
|
||||
|
|
|
@ -27,7 +27,7 @@ func main() {
|
|||
}
|
||||
|
||||
master.Robots = append(master.Robots, gobot.NewRobot(
|
||||
""
|
||||
"",
|
||||
nil,
|
||||
nil,
|
||||
func() {
|
||||
|
|
Loading…
Reference in New Issue