gobot.io/x/gobot@v1.16.0/platforms/pebble/doc.go (about) 1 /* 2 Package pebble contains the Gobot adaptor and driver for Pebble smart watch. 3 4 Installing: 5 6 It requires the 2.x iOS or Android app, and "watchbot" app (https://gobot.io/x/watchbot) 7 installed on Pebble watch. Then install running: 8 9 go get gobot.io/x/gobot/platforms/pebble 10 11 Example: 12 13 Before running the example, make sure configuration settings match with your program. In the example, api host is your computer IP, robot name is 'pebble' and robot api port is 8080 14 15 package main 16 17 import ( 18 "fmt" 19 20 "gobot.io/x/gobot" 21 "gobot.io/x/gobot/api" 22 "gobot.io/x/gobot/platforms/pebble" 23 ) 24 25 func main() { 26 master := gobot.NewMaster() 27 api.NewAPI(master).Start() 28 29 pebbleAdaptor := pebble.NewAdaptor() 30 watch := pebble.NewDriver(pebbleAdaptor) 31 32 work := func() { 33 watch.SendNotification("Hello Pebble!") 34 watch.On(watch.Event("button"), func(data interface{}) { 35 fmt.Println("Button pushed: " + data.(string)) 36 }) 37 38 watch.On(watch.Event("tap"), func(data interface{}) { 39 fmt.Println("Tap event detected") 40 }) 41 } 42 43 robot := gobot.NewRobot("pebble", 44 []gobot.Connection{pebbleAdaptor}, 45 []gobot.Device{watch}, 46 work, 47 ) 48 49 master.AddRobot(robot) 50 51 master.Start() 52 } 53 54 For more information refer to the pebble README: 55 https://github.com/hybridgroup/gobot/blob/master/platforms/pebble/README.md 56 */ 57 package pebble // import "gobot.io/x/gobot/platforms/pebble"