mirror of https://github.com/espruino/BangleApps
Update app.js
parent
4be76545e9
commit
c283f81af2
|
@ -1,25 +1,23 @@
|
||||||
//Bangle.setLCDPower(1); //debugging purposes
|
g.clear();
|
||||||
//Bangle.setLCDTimeout(0); // debugging purposes
|
let amount = 'global value';
|
||||||
g.clear(); // clear screen
|
function FindFD6FBeacons() {
|
||||||
let amount = 'global value'; // make amount global
|
NRF.findDevices(function(devices) {
|
||||||
function FindFD6FBeacons() { // function for finding COVID beacons
|
g.setFont('Vector', 75);
|
||||||
NRF.findDevices(function(devices) { // function for searching for devices with the UUID of FD6F
|
g.setFontAlign(0,0);
|
||||||
g.setFont('Vector', 75); // set size of font to 75x
|
var amount = devices.length;
|
||||||
g.setFontAlign(0,0); // align font
|
g.clear();
|
||||||
var amount = devices.length; // get amount of devices matching FD6F
|
g.drawString(amount, 125, 100);
|
||||||
g.clear(); // clear screen
|
if (amount == 1) {
|
||||||
g.drawString(amount, 125, 100); // draw amount of devices matching FD6F
|
g.setFont('Vector', 25);
|
||||||
if (amount == 1) { // check to see if we need to use the word users or user
|
g.drawString('FD6F', 125, 150);
|
||||||
g.setFont('Vector', 25); // set size of font to 25x
|
g.drawString('beacon', 125, 175);
|
||||||
g.drawString('FD6F', 125, 150); // draw string
|
g.drawString('nearby', 125, 200);
|
||||||
g.drawString('beacon', 125, 175); // draw string
|
} else{
|
||||||
g.drawString('nearby', 125, 200); // draw string
|
g.setFont('Vector', 25);
|
||||||
} else{ // if more than one change user to users
|
g.drawString('FD6F', 125, 150);
|
||||||
g.setFont('Vector', 25); // set size of font to 25x
|
g.drawString('beacons', 125, 175);
|
||||||
g.drawString('FD6F', 125, 150); // draw string
|
g.drawString('nearby', 125, 200);
|
||||||
g.drawString('beacons', 125, 175); // draw string
|
|
||||||
g.drawString('nearby', 125, 200); // draw string
|
|
||||||
}
|
}
|
||||||
}, {timeout : 1000, filters : [{services: ['fd6f'] }] }); // set filters to target only FD6F beacons
|
}, {timeout : 1000, filters : [{services: ['fd6f'] }] });
|
||||||
}
|
}
|
||||||
setInterval(FindFD6FBeacons, 2000); // poll for new devices
|
setInterval(FindFD6FBeacons, 2000);
|
||||||
|
|
Loading…
Reference in New Issue