Correct indentation for doc.go in sphero package

This commit is contained in:
Javier Cervantes 2014-10-21 12:30:06 -05:00
parent 8fc24b5a9a
commit af7dbf8bb1
1 changed files with 28 additions and 28 deletions

View File

@ -4,42 +4,42 @@ This package provides the Gobot adaptor and driver for the Sphero (http://www.go
Installing: Installing:
go get github.com/hybridgroup/gobot && go install github.com/hybridgroup/gobot/platforms/sphero go get github.com/hybridgroup/gobot && go install github.com/hybridgroup/gobot/platforms/sphero
Example: Example:
package main package main
import ( import (
"fmt" "fmt"
"time" "time"
"github.com/hybridgroup/gobot" "github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/sphero" "github.com/hybridgroup/gobot/platforms/sphero"
)
func main() {
gbot := gobot.NewGobot()
adaptor := sphero.NewSpheroAdaptor("sphero", "/dev/rfcomm0")
driver := sphero.NewSpheroDriver(adaptor, "sphero")
work := func() {
gobot.Every(3*time.Second, func() {
driver.Roll(30, uint16(gobot.Rand(360)))
})
}
robot := gobot.NewRobot("sphero",
[]gobot.Connection{adaptor},
[]gobot.Device{driver},
work,
) )
func main() { gbot.AddRobot(robot)
gbot := gobot.NewGobot()
adaptor := sphero.NewSpheroAdaptor("sphero", "/dev/rfcomm0") gbot.Start()
driver := sphero.NewSpheroDriver(adaptor, "sphero") }
work := func() {
gobot.Every(3*time.Second, func() {
driver.Roll(30, uint16(gobot.Rand(360)))
})
}
robot := gobot.NewRobot("sphero",
[]gobot.Connection{adaptor},
[]gobot.Device{driver},
work,
)
gbot.AddRobot(robot)
gbot.Start()
}
For futher information refer to sphero readme: For futher information refer to sphero readme:
https://github.com/hybridgroup/gobot/blob/master/platforms/sphero/README.md https://github.com/hybridgroup/gobot/blob/master/platforms/sphero/README.md