gobot.io/x/gobot@v1.16.0/platforms/pebble/README.md (about) 1 # Pebble 2 3 This repository contains the Gobot adaptor for [Pebble smart watch](http://getpebble.com/). 4 5 It uses the Pebble 2.0 SDK, and requires the 2.0 iOS or Android app, and that the ["watchbot" app](https://gobot.io/x/watchbot) has been installed on the Pebble watch. 6 7 ## How to Install 8 9 ``` 10 go get -d -u gobot.io/x/gobot/... 11 ``` 12 13 * Install Pebble 2.0 iOS or Android app. (If you haven't already) 14 * Follow README to install and configure "watchbot" on your watch: https://gobot.io/x/watchbot 15 16 ## How to Use 17 18 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 19 20 ```go 21 package main 22 23 import ( 24 "fmt" 25 26 "gobot.io/x/gobot" 27 "gobot.io/x/gobot/api" 28 "gobot.io/x/gobot/platforms/pebble" 29 ) 30 31 func main() { 32 master := gobot.NewMaster() 33 api.NewAPI(master).Start() 34 35 pebbleAdaptor := pebble.NewAdaptor() 36 watch := pebble.NewDriver(pebbleAdaptor) 37 38 work := func() { 39 watch.SendNotification("Hello Pebble!") 40 watch.On(watch.Event("button"), func(data interface{}) { 41 fmt.Println("Button pushed: " + data.(string)) 42 }) 43 44 watch.On(watch.Event("tap"), func(data interface{}) { 45 fmt.Println("Tap event detected") 46 }) 47 } 48 49 robot := gobot.NewRobot("pebble", 50 []gobot.Connection{pebbleAdaptor}, 51 []gobot.Device{watch}, 52 work, 53 ) 54 55 master.AddRobot(robot) 56 57 master.Start() 58 } 59 60 ``` 61 62 ## Supported Features 63 64 * We support event detection of 3 main pebble buttons. 65 * Accelerometer events 66 * Pushing data to pebble watch 67 68 ## Documentation 69 70 We're busy adding documentation to our web site at http://gobot.io/ please check there as we continue to work on Gobot 71 72 Thank you! 73 74 ## Contributing 75 76 * All patches must be provided under the Apache 2.0 License 77 * Please use the -s option in git to "sign off" that the commit is your work and you are providing it under the Apache 2.0 License 78 * Submit a Github Pull Request to the appropriate branch and ideally discuss the changes with us in IRC. 79 * We will look at the patch, test it out, and give you feedback. 80 * Avoid doing minor whitespace changes, renamings, etc. along with merged content. These will be done by the maintainers from time to time but they can complicate merges and should be done seperately. 81 * Take care to maintain the existing coding style. 82 * Add unit tests for any new or changed functionality 83 * All pull requests should be "fast forward" 84 * If there are commits after yours use “git rebase -i <new_head_branch>” 85 * If you have local changes you may need to use “git stash” 86 * For git help see [progit](http://git-scm.com/book) which is an awesome (and free) book on git 87 88 ## License 89 90 Copyright (c) 2013-2018 The Hybrid Group. Licensed under the Apache 2.0 license.