diff --git a/apps/fd6fdetect/app.js b/apps/fd6fdetect/app.js index dc2649abc..a7ef71994 100644 --- a/apps/fd6fdetect/app.js +++ b/apps/fd6fdetect/app.js @@ -1,25 +1,23 @@ -//Bangle.setLCDPower(1); //debugging purposes -//Bangle.setLCDTimeout(0); // debugging purposes -g.clear(); // clear screen -let amount = 'global value'; // make amount global -function FindFD6FBeacons() { // function for finding COVID beacons -NRF.findDevices(function(devices) { // function for searching for devices with the UUID of FD6F - g.setFont('Vector', 75); // set size of font to 75x - g.setFontAlign(0,0); // align font - var amount = devices.length; // get amount of devices matching FD6F - g.clear(); // clear screen - g.drawString(amount, 125, 100); // draw amount of devices matching FD6F - if (amount == 1) { // check to see if we need to use the word users or user - g.setFont('Vector', 25); // set size of font to 25x - g.drawString('FD6F', 125, 150); // draw string - g.drawString('beacon', 125, 175); // draw string - g.drawString('nearby', 125, 200); // draw string - } else{ // if more than one change user to users - g.setFont('Vector', 25); // set size of font to 25x - g.drawString('FD6F', 125, 150); // draw string - g.drawString('beacons', 125, 175); // draw string - g.drawString('nearby', 125, 200); // draw string +g.clear(); +let amount = 'global value'; +function FindFD6FBeacons() { +NRF.findDevices(function(devices) { + g.setFont('Vector', 75); + g.setFontAlign(0,0); + var amount = devices.length; + g.clear(); + g.drawString(amount, 125, 100); + if (amount == 1) { + g.setFont('Vector', 25); + g.drawString('FD6F', 125, 150); + g.drawString('beacon', 125, 175); + g.drawString('nearby', 125, 200); + } else{ + g.setFont('Vector', 25); + g.drawString('FD6F', 125, 150); + g.drawString('beacons', 125, 175); + g.drawString('nearby', 125, 200); } -}, {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);