@@ -39,75 +39,69 @@ my.pebble.on('accel', function(data) {
39
39
##### Hello Pebble!
40
40
41
41
``` javascript
42
- var Cylon = require (' cylon' );
42
+ var Cylon = require (" cylon" );
43
43
44
44
Cylon .api ({
45
- host: ' 0.0.0.0' ,
46
- port: ' 8080' ,
47
- ssl: false
45
+ host: " 0.0.0.0" ,
46
+ port: " 8080" ,
47
+ ssl: false
48
48
});
49
49
50
50
Cylon .robot ({
51
- name: ' pebble' ,
51
+ name: " pebble" ,
52
52
53
- connection: {
54
- name: ' pebble' ,
55
- adaptor: ' pebble'
53
+ connections: {
54
+ pebble: { adaptor: " pebble" }
56
55
},
57
56
58
- device: {
59
- name: ' pebble' ,
60
- driver: ' pebble'
57
+ devices: {
58
+ pebble: { driver: " pebble" }
61
59
},
62
60
63
61
work : function (my ) {
64
62
my .pebble .send_notification (" Hello Pebble!" );
65
63
66
- my .pebble .on (' button' , function (data ) {
64
+ my .pebble .on (" button" , function (data ) {
67
65
console .log (" Button pushed: " + data);
68
66
});
69
67
70
- my .pebble .on (' tap' , function (data ) {
68
+ my .pebble .on (" tap" , function () {
71
69
console .log (" Tap event detected" );
72
70
});
73
71
}
74
- });
75
-
76
- Cylon .start ();
72
+ }).start ();
77
73
```
78
74
79
75
##### Accelerometer
80
76
81
77
``` javascript
82
- var Cylon = require (' cylon' );
78
+ " use strict" ;
79
+
80
+ var Cylon = require (" cylon" );
83
81
84
82
Cylon .api ({
85
- host: ' 0.0.0.0' ,
86
- port: ' 8080' ,
87
- ssl: false
83
+ host: " 0.0.0.0" ,
84
+ port: " 8080" ,
85
+ ssl: false
88
86
});
89
87
90
88
Cylon .robot ({
91
- name: ' pebble' ,
89
+ name: " pebble" ,
92
90
93
- connection: {
94
- name: ' pebble' ,
95
- adaptor: ' pebble'
91
+ connections: {
92
+ pebble: { adaptor: " pebble" }
96
93
},
97
94
98
- device: {
99
- name: ' pebble' ,
100
- driver: ' pebble'
95
+ devices: {
96
+ pebble: { driver: " pebble" }
101
97
},
102
98
103
99
work : function (my ) {
104
100
my .pebble .on (' accel' , function (data ) {
105
101
console .log (data);
106
102
});
107
103
}
108
- });
109
-
110
- Cylon .start ();
104
+ }).start ();
111
105
```
112
106
113
107
### More information about pebble drivers/adaptors
@@ -131,17 +125,20 @@ After app is installed, click on "Settings" and configure:
131
125
* robot name
132
126
* robot api host
133
127
* robot api port
128
+ * device name
134
129
135
130
# Usage
136
131
137
132
Watchbot has 3 main sections:
138
133
134
+ * Commands: Execute custom commands defined in your robot.
139
135
* Events: Listen to tap and button events.
140
136
* Accelerometer: Send x/y/z accel data to your programs.
141
- * Commands: Execute custom commands defined in your robot.
142
137
143
138
# Releases
144
139
140
+ * 2.3 - Updated to Pebble SDK 3.0, fixed config page on iOS.
141
+
145
142
* 2.0 - Adding menu to listen to events, execute commands or send accel information. Using pebblejs.
146
143
147
144
* 0.2.0 - Compatible with CPPP.io robot API
@@ -177,15 +174,4 @@ Watchbot has 3 main sections:
177
174
178
175
## LICENSE
179
176
180
- Copyright (c) 2014 The Hybrid Group
181
-
182
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
183
- this file except in compliance with the License. You may obtain a copy of the
184
- License at
185
-
186
- http://www.apache.org/licenses/LICENSE-2.0
187
-
188
- Unless required by applicable law or agreed to in writing, software distributed
189
- under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
190
- CONDITIONS OF ANY KIND, either express or implied. See the License for the
191
- specific language governing permissions and limitations under the License.
177
+ Copyright (c) 2013-2015 The Hybrid Group. Licensed under the Apache 2.0 license
0 commit comments