Updates to ongoing development

master
Ephraim Amiel Yusi 2020-05-27 18:08:16 +10:00 committed by GitHub
parent 5f0fe5859f
commit f6d2017789
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 3 deletions

View File

@ -43,7 +43,7 @@ function drawSteps() {
g.setFontAlign(-1,0); // align right bottom
g.drawString("STEPS", 145, 40, true /*clear background*/);
g.setColor('#bdc3c7');
g.drawString("1234", 145, 70, true /*clear background*/);
g.drawString("-", 145, 65, true /*clear background*/);
}
function drawBPM() {
@ -53,9 +53,22 @@ function drawBPM() {
g.setColor('#7f8c8d');
g.setFont("8x12",2);
g.setFontAlign(-1,0); // align right bottom
g.drawString("BPM", 145, 120, true /*clear background*/);
g.drawString("BPM", 145, 105, true /*clear background*/);
g.setColor('#bdc3c7');
g.drawString("1234", 145, 150, true /*clear background*/);
g.drawString("-", 145, 130, true /*clear background*/);
}
function drawBattery() {
let charge = E.getBattery();
//Reset to defaults.
g.reset();
// draw the date (2x size 7 segment)
g.setColor('#7f8c8d');
g.setFont("8x12",2);
g.setFontAlign(-1,0); // align right bottom
g.drawString("CHARGE", 145, 170, true /*clear background*/);
g.setColor('#bdc3c7');
g.drawString(`${charge}%`, 145, 195, true /*clear background*/);
}
@ -65,6 +78,7 @@ g.clear();
drawTimeDate();
drawSteps();
drawBPM();
drawBattery();
var secondInterval = setInterval(()=>{
drawTimeDate();
@ -77,6 +91,7 @@ Bangle.on('lcdPower',on=>{
if (on) {
setInterval(drawTimeDate, 5000);
drawTimeDate(); // draw immediately
drawBattery(); //draw battery
}
});
@ -90,3 +105,7 @@ setWatch(Bangle.showLauncher, BTN2, { repeat: false, edge: "falling" });
Bangle.on('touch', function(button) {
if(button == 1 || button == 2) Bangle.showLauncher();
});
//Bangle.on('step', function(up) {
// console.log("Step");
//});