Skip to content

Commit

Permalink
docs: go fmt files that needed it from recent changes
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Sep 12, 2016
1 parent 94d78d7 commit 3540ce7
Show file tree
Hide file tree
Showing 20 changed files with 128 additions and 128 deletions.
2 changes: 1 addition & 1 deletion examples/ardrone_face_tracking.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"runtime"
"time"

cv "github.com/lazywei/go-opencv/opencv"
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/ardrone"
"github.com/hybridgroup/gobot/platforms/opencv"
cv "github.com/lazywei/go-opencv/opencv"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/bebop.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func main() {
})
})

drone.HullProtection(true)
drone.HullProtection(true)
drone.TakeOff()
}

Expand Down
2 changes: 1 addition & 1 deletion examples/bebop_ps3_video.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func main() {
for {
if _, err := video.Write(<-drone.Video()); err != nil {
fmt.Println(err)
return
return
}
}
}()
Expand Down
2 changes: 1 addition & 1 deletion examples/ble_battery.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"fmt"
"time"
"os"
"time"

"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/ble"
Expand Down
2 changes: 1 addition & 1 deletion examples/chip_grove_accelerometer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"time"

"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/i2c"
"github.com/hybridgroup/gobot/platforms/chip"
"github.com/hybridgroup/gobot/platforms/i2c"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/chip_grove_lcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"time"

"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/i2c"
"github.com/hybridgroup/gobot/platforms/chip"
"github.com/hybridgroup/gobot/platforms/i2c"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/chip_mpu6050.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"time"

"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/chip"
"github.com/hybridgroup/gobot/platforms/i2c"
"github.com/hybridgroup/gobot/platforms/chip"
)

func main() {
Expand Down
44 changes: 22 additions & 22 deletions examples/edison_button_led.go
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
package main

import (
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/gpio"
"github.com/hybridgroup/gobot/platforms/intel-iot/edison"
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/gpio"
"github.com/hybridgroup/gobot/platforms/intel-iot/edison"
)

func main() {
gbot := gobot.NewGobot()
gbot := gobot.NewGobot()

e := edison.NewEdisonAdaptor("edison")
e := edison.NewEdisonAdaptor("edison")

button := gpio.NewButtonDriver(e, "myButton", "2")
led := gpio.NewLedDriver(e, "myLed", "4")
button := gpio.NewButtonDriver(e, "myButton", "2")
led := gpio.NewLedDriver(e, "myLed", "4")

work := func() {
button.On(gpio.ButtonPush, func(data interface{}) {
led.On()
})
button.On(gpio.ButtonRelease, func(data interface{}) {
led.Off()
})
}
work := func() {
button.On(gpio.ButtonPush, func(data interface{}) {
led.On()
})
button.On(gpio.ButtonRelease, func(data interface{}) {
led.Off()
})
}

robot := gobot.NewRobot("buttonBot",
[]gobot.Connection{e},
[]gobot.Device{led, button},
work,
)
robot := gobot.NewRobot("buttonBot",
[]gobot.Connection{e},
[]gobot.Device{led, button},
work,
)

gbot.AddRobot(robot)
gbot.AddRobot(robot)

gbot.Start()
gbot.Start()
}
48 changes: 24 additions & 24 deletions examples/edison_button_led_api.go
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
package main

import (
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/gpio"
"github.com/hybridgroup/gobot/platforms/intel-iot/edison"
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/gpio"
"github.com/hybridgroup/gobot/platforms/intel-iot/edison"

"github.com/hybridgroup/gobot/api"
"github.com/hybridgroup/gobot/api"
)

func main() {
gbot := gobot.NewGobot()
api.NewAPI(gbot).Start()
gbot := gobot.NewGobot()
api.NewAPI(gbot).Start()

e := edison.NewEdisonAdaptor("edison")
e := edison.NewEdisonAdaptor("edison")

button := gpio.NewButtonDriver(e, "myButton", "2")
led := gpio.NewLedDriver(e, "myLed", "4")
button := gpio.NewButtonDriver(e, "myButton", "2")
led := gpio.NewLedDriver(e, "myLed", "4")

work := func() {
button.On(gpio.ButtonPush, func(data interface{}) {
led.On()
})
button.On(gpio.ButtonRelease, func(data interface{}) {
led.Off()
})
}
work := func() {
button.On(gpio.ButtonPush, func(data interface{}) {
led.On()
})
button.On(gpio.ButtonRelease, func(data interface{}) {
led.Off()
})
}

robot := gobot.NewRobot("buttonBot",
[]gobot.Connection{e},
[]gobot.Device{led, button},
work,
)
robot := gobot.NewRobot("buttonBot",
[]gobot.Connection{e},
[]gobot.Device{led, button},
work,
)

gbot.AddRobot(robot)
gbot.AddRobot(robot)

gbot.Start()
gbot.Start()
}
2 changes: 1 addition & 1 deletion examples/firmata_integration.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main

import (
"time"
"fmt"
"time"

"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/firmata"
Expand Down
2 changes: 1 addition & 1 deletion examples/firmata_mpl115a2.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ func main() {
gbot.AddRobot(robot)

gbot.Start()
}
}
2 changes: 1 addition & 1 deletion examples/firmata_rgb_led.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"time"

"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/gpio"
"github.com/hybridgroup/gobot/platforms/firmata"
"github.com/hybridgroup/gobot/platforms/gpio"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/minidrone.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main

import (
"os"
"fmt"
"os"
"time"

"github.com/hybridgroup/gobot"
Expand Down
2 changes: 1 addition & 1 deletion examples/minidrone_ps3.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"math"
"time"
"os"
"time"

"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/ble"
Expand Down
2 changes: 1 addition & 1 deletion examples/ollie.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"os"
"time"

"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/ble"
)
Expand Down
2 changes: 1 addition & 1 deletion examples/opencv_face_detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"runtime"
"time"

cv "github.com/lazywei/go-opencv/opencv"
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/opencv"
cv "github.com/lazywei/go-opencv/opencv"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/opencv_window.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package main

import (
cv "github.com/lazywei/go-opencv/opencv"
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/opencv"
cv "github.com/lazywei/go-opencv/opencv"
)

func main() {
Expand Down
76 changes: 38 additions & 38 deletions examples/sphero_dpad.go
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
package main

import (
"time"
"time"

"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/api"
"github.com/hybridgroup/gobot/platforms/sphero"
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/api"
"github.com/hybridgroup/gobot/platforms/sphero"
)

func main() {
gbot := gobot.NewGobot()
a := api.NewAPI(gbot)
a.Start()

conn := sphero.NewSpheroAdaptor("Sphero", "/dev/rfcomm0")
ball := sphero.NewSpheroDriver(conn, "sphero")

robot := gobot.NewRobot("sphero-dpad",
[]gobot.Connection{conn},
[]gobot.Device{ball},
)

robot.AddCommand("move", func(params map[string]interface{}) interface{} {
direction := params["direction"].(string)

switch direction {
case "up":
ball.Roll(100, 0)
case "down":
ball.Roll(100, 180)
case "left":
ball.Roll(100, 270)
case "right":
ball.Roll(100, 90)
}

time.Sleep(2 * time.Second)
ball.Stop()
return "ok"
})

gbot.AddRobot(robot)

gbot.Start()
gbot := gobot.NewGobot()
a := api.NewAPI(gbot)
a.Start()

conn := sphero.NewSpheroAdaptor("Sphero", "/dev/rfcomm0")
ball := sphero.NewSpheroDriver(conn, "sphero")

robot := gobot.NewRobot("sphero-dpad",
[]gobot.Connection{conn},
[]gobot.Device{ball},
)

robot.AddCommand("move", func(params map[string]interface{}) interface{} {
direction := params["direction"].(string)

switch direction {
case "up":
ball.Roll(100, 0)
case "down":
ball.Roll(100, 180)
case "left":
ball.Roll(100, 270)
case "right":
ball.Roll(100, 90)
}

time.Sleep(2 * time.Second)
ball.Stop()
return "ok"
})

gbot.AddRobot(robot)

gbot.Start()
}
Loading

0 comments on commit 3540ce7

Please sign in to comment.