Skip to content

Commit

Permalink
examples: remove Master unless needed for less code
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Oct 18, 2016
1 parent 2f9d0fd commit 4230d2a
Show file tree
Hide file tree
Showing 126 changed files with 181 additions and 597 deletions.
5 changes: 1 addition & 4 deletions examples/ardrone.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
)

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

ardroneAdaptor := ardrone.NewAdaptor()
drone := ardrone.NewDriver(ardroneAdaptor)

Expand All @@ -27,7 +25,6 @@ func main() {
[]gobot.Device{drone},
work,
)
gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}
6 changes: 1 addition & 5 deletions examples/ardrone_face_tracking.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import (
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())

gbot := gobot.NewMaster()

_, currentfile, _, _ := runtime.Caller(0)
cascade := path.Join(path.Dir(currentfile), "haarcascade_frontalface_alt.xml")
window := opencv.NewWindowDriver()
Expand Down Expand Up @@ -76,7 +74,5 @@ func main() {
work,
)

gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}
6 changes: 1 addition & 5 deletions examples/ardrone_ps3.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ type pair struct {
}

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

joystickAdaptor := joystick.NewAdaptor()
stick := joystick.NewDriver(joystickAdaptor,
"./platforms/joystick/configs/dualshock3.json",
Expand Down Expand Up @@ -109,9 +107,7 @@ func main() {
work,
)

gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}

func validatePitch(data float64, offset float64) float64 {
Expand Down
6 changes: 1 addition & 5 deletions examples/audio.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
)

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

e := audio.NewAdaptor()
laser := audio.NewDriver(e, "./examples/laser.mp3")

Expand All @@ -25,7 +23,5 @@ func main() {
work,
)

gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}
2 changes: 0 additions & 2 deletions examples/beaglebone_basic_direct_pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import (
)

func main() {

// Use Gobot to control BeagleBone's digital pins directly

beagleboneAdaptor := beaglebone.NewAdaptor()
gpioPin := gpio.NewDirectPinDriver(beagleboneAdaptor, "P9_12")

Expand Down
6 changes: 1 addition & 5 deletions examples/beaglebone_blink.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
)

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

beagleboneAdaptor := beaglebone.NewAdaptor()
led := gpio.NewLedDriver(beagleboneAdaptor, "P9_12")

Expand All @@ -26,7 +24,5 @@ func main() {
work,
)

gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}
6 changes: 1 addition & 5 deletions examples/beaglebone_blink_usr_led.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
)

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

beagleboneAdaptor := beaglebone.NewAdaptor()
led := gpio.NewLedDriver(beagleboneAdaptor, "usr0")

Expand All @@ -26,7 +24,5 @@ func main() {
work,
)

gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}
5 changes: 1 addition & 4 deletions examples/beaglebone_blinkm.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
)

func main() {
gbot := gobot.NewMaster()
beagleboneAdaptor := beaglebone.NewAdaptor()
blinkm := i2c.NewBlinkMDriver(beagleboneAdaptor)

Expand All @@ -31,7 +30,5 @@ func main() {
work,
)

gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}
6 changes: 2 additions & 4 deletions examples/beaglebone_button.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
)

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

beagleboneAdaptor := beaglebone.NewAdaptor()
button := gpio.NewButtonDriver(beagleboneAdaptor, "P8_9")

Expand All @@ -29,6 +27,6 @@ func main() {
[]gobot.Device{button},
work,
)
gbot.AddRobot(robot)
gbot.Start()

robot.Start()
}
6 changes: 1 addition & 5 deletions examples/beaglebone_direct_pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
)

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

beagleboneAdaptor := beaglebone.NewAdaptor()
led := gpio.NewDirectPinDriver(beagleboneAdaptor, "P8_10")
button := gpio.NewDirectPinDriver(beagleboneAdaptor, "P8_9")
Expand All @@ -32,7 +30,5 @@ func main() {
work,
)

gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}
5 changes: 1 addition & 4 deletions examples/beaglebone_led_brightness.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
)

func main() {
gbot := gobot.NewMaster()
beagleboneAdaptor := beaglebone.NewAdaptor()
led := gpio.NewLedDriver(beagleboneAdaptor, "P9_14")

Expand All @@ -32,7 +31,5 @@ func main() {
work,
)

gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}
6 changes: 1 addition & 5 deletions examples/beaglebone_led_brightness_with_analog_input.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
)

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

beagleboneAdaptor := beaglebone.NewAdaptor()
sensor := gpio.NewAnalogSensorDriver(beagleboneAdaptor, "P9_33")
led := gpio.NewLedDriver(beagleboneAdaptor, "P9_14")
Expand All @@ -32,7 +30,5 @@ func main() {
work,
)

gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}
6 changes: 1 addition & 5 deletions examples/beaglebone_makey_button.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
)

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

beagleboneAdaptor := beaglebone.NewAdaptor()
button := gpio.NewMakeyButtonDriver(beagleboneAdaptor, "P8_9")

Expand All @@ -30,7 +28,5 @@ func main() {
work,
)

gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}
5 changes: 1 addition & 4 deletions examples/beaglebone_servo.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
)

func main() {
gbot := gobot.NewMaster()
beagleboneAdaptor := beaglebone.NewAdaptor()
servo := gpio.NewServoDriver(beagleboneAdaptor, "P9_14")

Expand All @@ -28,7 +27,5 @@ func main() {
work,
)

gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}
5 changes: 1 addition & 4 deletions examples/bebop.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
)

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

bebopAdaptor := bebop.NewAdaptor()
drone := bebop.NewDriver(bebopAdaptor)

Expand All @@ -29,7 +27,6 @@ func main() {
[]gobot.Device{drone},
work,
)
gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}
6 changes: 1 addition & 5 deletions examples/bebop_ps3.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ type pair struct {
}

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

joystickAdaptor := joystick.NewAdaptor()
stick := joystick.NewDriver(joystickAdaptor,
"./platforms/joystick/configs/dualshock3.json",
Expand Down Expand Up @@ -121,9 +119,7 @@ func main() {
work,
)

gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}

func validatePitch(data float64, offset float64) int {
Expand Down
6 changes: 1 addition & 5 deletions examples/bebop_ps3_video.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ func ffmpeg() (stdin io.WriteCloser, stderr io.ReadCloser, err error) {
}

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

joystickAdaptor := joystick.NewAdaptor()
stick := joystick.NewDriver(joystickAdaptor,
"./platforms/joystick/configs/dualshock3.json",
Expand Down Expand Up @@ -170,9 +168,7 @@ func main() {
work,
)

gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}

func validatePitch(data float64, offset float64) int {
Expand Down
6 changes: 1 addition & 5 deletions examples/ble_battery.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (
)

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

bleAdaptor := ble.NewClientAdaptor(os.Args[1])
battery := ble.NewBatteryDriver(bleAdaptor)

Expand All @@ -27,7 +25,5 @@ func main() {
work,
)

gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}
6 changes: 1 addition & 5 deletions examples/ble_device_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
)

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

bleAdaptor := ble.NewClientAdaptor(os.Args[1])
info := ble.NewDeviceInformationDriver(bleAdaptor)

Expand All @@ -28,7 +26,5 @@ func main() {
work,
)

gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}
6 changes: 1 addition & 5 deletions examples/chip_blink.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
)

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

chipAdaptor := chip.NewAdaptor()
led := gpio.NewLedDriver(chipAdaptor, "XIO-P0")

Expand All @@ -26,7 +24,5 @@ func main() {
work,
)

gbot.AddRobot(robot)

gbot.Start()
robot.Start()
}
6 changes: 2 additions & 4 deletions examples/chip_button.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
)

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

chipAdaptor := chip.NewAdaptor()
button := gpio.NewButtonDriver(chipAdaptor, "XIO-P0")

Expand All @@ -29,6 +27,6 @@ func main() {
[]gobot.Device{button},
work,
)
gbot.AddRobot(robot)
gbot.Start()

robot.Start()
}
6 changes: 2 additions & 4 deletions examples/chip_button_led.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
)

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

chipAdaptor := chip.NewAdaptor()
button := gpio.NewButtonDriver(chipAdaptor, "XIO-P6")
led := gpio.NewLedDriver(chipAdaptor, "XIO-P7")
Expand All @@ -28,6 +26,6 @@ func main() {
[]gobot.Device{button, led},
work,
)
gbot.AddRobot(robot)
gbot.Start()

robot.Start()
}
Loading

0 comments on commit 4230d2a

Please sign in to comment.