Bangle js: Difference between revisions
Jump to navigation
Jump to search
Created page with "== Bangle.js 1 & 2 == this is an open source smart watch that can be easily programmed in java script. * https://www.espruino.com/ * https://www.espruino.com/Bangle.js * https..." |
|||
(12 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[File:Bangle1js.JPG|800px]] | |||
== 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 == | == Bangle.js 1 & 2 == | ||
this is an open source smart watch that can be easily programmed in java script. | this is an open source smart watch that can be easily programmed in java script. | ||
Line 5: | Line 21: | ||
* https://www.espruino.com/Bangle.js2 | * https://www.espruino.com/Bangle.js2 | ||
== Examples and Tutorials | == Examples and Tutorials == | ||
* https://www.espruino.com/Quick+Start+Code | * https://www.espruino.com/Quick+Start+Code | ||
* https://www.espruino.com/Tutorials | * https://www.espruino.com/Tutorials | ||
* https://banglejs.com/apps/ | * https://banglejs.com/apps/ | ||
* https://gist.github.com/rozek | * https://gist.github.com/rozek | ||
=== Visualizing Acceleration data === | |||
Example from: https://github.com/espruino/BangleApps/blob/master/apps/accelgraph/app.js | |||
<syntaxhighlight lang="javascript" line='line'> | |||
Bangle.loadWidgets(); | |||
g.clear(1); | |||
Bangle.drawWidgets(); | |||
var R = Bangle.appRect; | |||
var x = 0; | |||
var last; | |||
function getY(v) { | |||
return (R.y+R.y2 + v*R.h/2)/2; | |||
} | |||
Bangle.on('accel', a => { | |||
g.reset(); | |||
if (last) { | |||
g.setColor("#f00").drawLine(x-1,getY(last.x),x,getY(a.x)); | |||
g.setColor("#0f0").drawLine(x-1,getY(last.y),x,getY(a.y)); | |||
g.setColor("#00f").drawLine(x-1,getY(last.z),x,getY(a.z)); | |||
} | |||
last = a;x++; | |||
if (x>=g.getWidth()) { | |||
x = 1; | |||
g.clearRect(R); | |||
} | |||
}); | |||
</syntaxhighlight> | |||
== Bangle.js IDE == | == Bangle.js IDE == | ||
There is a online IDE that uses Web-BLE to program the watch. There is no need for any local installation. | There is a online IDE that uses Web-BLE to program the watch. There is no need for any local installation. | ||
* https://www.espruino.com/ide/ | * IDE https://www.espruino.com/ide/ | ||
* Emulator https://www.espruino.com/ide/?emulator | |||
[[File:Bangle_ide.JPG|800px]] | |||
(Example show is a timer: https://www.espruino.com/Bangle.js+First+App) |
Latest revision as of 18:29, 23 March 2022
some Features[edit]
- 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[edit]
this is an open source smart watch that can be easily programmed in java script.
Examples and Tutorials[edit]
- https://www.espruino.com/Quick+Start+Code
- https://www.espruino.com/Tutorials
- https://banglejs.com/apps/
- https://gist.github.com/rozek
Visualizing Acceleration data[edit]
Example from: https://github.com/espruino/BangleApps/blob/master/apps/accelgraph/app.js
Bangle.loadWidgets();
g.clear(1);
Bangle.drawWidgets();
var R = Bangle.appRect;
var x = 0;
var last;
function getY(v) {
return (R.y+R.y2 + v*R.h/2)/2;
}
Bangle.on('accel', a => {
g.reset();
if (last) {
g.setColor("#f00").drawLine(x-1,getY(last.x),x,getY(a.x));
g.setColor("#0f0").drawLine(x-1,getY(last.y),x,getY(a.y));
g.setColor("#00f").drawLine(x-1,getY(last.z),x,getY(a.z));
}
last = a;x++;
if (x>=g.getWidth()) {
x = 1;
g.clearRect(R);
}
});
Bangle.js IDE[edit]
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)