-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpuck_code.js
More file actions
35 lines (35 loc) · 725 Bytes
/
puck_code.js
File metadata and controls
35 lines (35 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
NRF.setServices({
0xabcd : {
0xAB40 : {
value : "Hello",
maxLen : 50,
notify: true
},
0xAB41 : {
value : "Hello",
maxLen : 50,
notify: true
}
}
}, {advertise: [ 0xabcd ]});
console.log('temp?', E.getTemperature());
var on = false;
setWatch(function(e) {
on = !on;
LED1.write(on);
//console.log('temp?', E.getTemperature());
var pressTime = e.time - e.lastTime;
NRF.updateServices({
0xBC10 : {
0xAB40 : {
value : "time: " + e.time,
notify: true
},
0xAB41 : {
value : "lastTime: " + e.lastTime,
maxLen : 50,
notify: true
},
}
});
}, BTN, { repeat:true, edge:"falling", debounce: 50 });