Difference between revisions of "Bangle js"
Jump to navigation
Jump to search
Line 28: | Line 28: | ||
=== Visualizing Acceleration data === | === Visualizing Acceleration data === | ||
+ | |||
+ | <syntaxhighlight lang="js" line='line'> | ||
Bangle.loadWidgets(); | Bangle.loadWidgets(); | ||
g.clear(1); | g.clear(1); | ||
Line 52: | Line 54: | ||
} | } | ||
}); | }); | ||
+ | </syntaxhighlight> | ||
== Bangle.js IDE == | == Bangle.js IDE == |
Revision as of 17:26, 23 March 2022
Contents
some Features
- 1.3 inch 240x240 16 bit LCD
- 2 zone touch
- Vibration motor
- GPS receiver (UBlox)
- Heart rate monitor
- 3 Axis Accelerometer, 3 Axis Magnetometer
- 350mAh battery (1 week standby time)
- Nordic 64MHz nRF52832 ARM Cortex-M4
- Bluetooth LE
- 64kB RAM 512kB on-chip flash, 4MB external flash
- Waterproof (up to 10m)
- NO Wifi!
Bangle.js 1 & 2
this is an open source smart watch that can be easily programmed in java script.
Examples and Tutorials
- https://www.espruino.com/Quick+Start+Code
- https://www.espruino.com/Tutorials
- https://banglejs.com/apps/
- https://gist.github.com/rozek
Visualizing Acceleration data
1 Bangle.loadWidgets();
2 g.clear(1);
3 Bangle.drawWidgets();
4 var R = Bangle.appRect;
5
6 var x = 0;
7 var last;
8
9 function getY(v) {
10 return (R.y+R.y2 + v*R.h/2)/2;
11 }
12 Bangle.on('accel', a => {
13 g.reset();
14 if (last) {
15 g.setColor("#f00").drawLine(x-1,getY(last.x),x,getY(a.x));
16 g.setColor("#0f0").drawLine(x-1,getY(last.y),x,getY(a.y));
17 g.setColor("#00f").drawLine(x-1,getY(last.z),x,getY(a.z));
18 }
19 last = a;x++;
20 if (x>=g.getWidth()) {
21 x = 1;
22 g.clearRect(R);
23 }
24 });
Bangle.js IDE
There is a online IDE that uses Web-BLE to program the watch. There is no need for any local installation.
(Example show is a timer: https://www.espruino.com/Bangle.js+First+App)