1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-05-02 22:17:12 +08:00
deadprogram 458c750f33 core: refactor/rename internal name of Master type
Signed-off-by: deadprogram <ron@hybridgroup.com>
2016-10-15 20:02:54 +02:00

32 lines
455 B
Go

package main
import (
"time"
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/audio"
)
func main() {
gbot := gobot.NewMaster()
e := audio.NewAdaptor()
laser := audio.NewDriver(e, "./examples/laser.mp3")
work := func() {
gobot.Every(2*time.Second, func() {
laser.Play()
})
}
robot := gobot.NewRobot("soundBot",
[]gobot.Connection{e},
[]gobot.Device{laser},
work,
)
gbot.AddRobot(robot)
gbot.Start()
}