platforms/pebble/README.md
This repository contains the Gobot adaptor for Pebble smart watch.
It uses the Pebble 2.0 SDK, and requires the 2.0 iOS or Android app, and that the "watchbot" app has been installed on the Pebble watch.
Please refer to the main README.md
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
package main
import (
"fmt"
"gobot.io/x/gobot/v2"
"gobot.io/x/gobot/v2/api"
"gobot.io/x/gobot/v2/platforms/pebble"
)
func main() {
manager := gobot.NewManager()
api.NewAPI(manager).Start()
pebbleAdaptor := pebble.NewAdaptor()
watch := pebble.NewDriver(pebbleAdaptor)
work := func() {
watch.SendNotification("Hello Pebble!")
watch.On(watch.Event("button"), func(data interface{}) {
fmt.Println("Button pushed: " + data.(string))
})
watch.On(watch.Event("tap"), func(data interface{}) {
fmt.Println("Tap event detected")
})
}
robot := gobot.NewRobot("pebble",
[]gobot.Connection{pebbleAdaptor},
[]gobot.Device{watch},
work,
)
manager.AddRobot(robot)
if err := manager.Start(); err != nil {
panic(err)
}
}
We're busy adding documentation to our web site at http://gobot.io/ please check there as we continue to work on Gobot
Thank you!
Copyright (c) 2013-2018 The Hybrid Group. Licensed under the Apache 2.0 license.