Skip to content

Commit

Permalink
Changed display text and function names.
Browse files Browse the repository at this point in the history
  • Loading branch information
got-x committed Apr 1, 2020
1 parent d95e009 commit 61fa3e7
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions apps/gbaudioc/gbaudioc.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,47 @@
function init() {
display();
setWatch(btn1, BTN1, {repeat:true});
setWatch(btn2, BTN2, {repeat:true});
setWatch(btn3, BTN3, {repeat:true});
setWatch(t1, BTN4, {repeat:true});
setWatch(t2, BTN5, {repeat:true});
setWatch(btn4, BTN4, {repeat:true});
setWatch(btn5, BTN5, {repeat:true});
display();
}

var displayText = "gbAudicC";

function btn1() {
Bluetooth.println(JSON.stringify({t:"info", msg:"btn1"}));
displayText = "btn1";
Bluetooth.println(JSON.stringify({t:"info", msg: displayText}));
display();
}
function btn2() {
Bluetooth.println(JSON.stringify({t:"info", msg:"btn2"}));
displayText = "btn2";
Bluetooth.println(JSON.stringify({t:"info", msg: displayText}));
display();
}
function btn3() {
Bluetooth.println(JSON.stringify({t:"info", msg:"btn3"}));
displayText = "btn3";
Bluetooth.println(JSON.stringify({t:"info", msg: displayText}));
display();
}
function btn4() {
Bluetooth.println(JSON.stringify({t:"info", msg:"btn4"}));
displayText = "btn4";
Bluetooth.println(JSON.stringify({t:"info", msg: displayText}));
display();
}
function btn5() {
Bluetooth.println(JSON.stringify({t:"info", msg:"btn5"}));
displayText = "btn5";
Bluetooth.println(JSON.stringify({t:"info", msg: displayText}));
display();
}

function display() {
g.clear();
g.setFontAlign(0,0); // center font
g.setFont("Vector",30);
// draw the current value
g.drawString("gbAudicC", g.getWidth()/2, g.getHeight()/2);
g.drawString(displayText, g.getWidth()/2, g.getHeight()/2);
// this keeps the watch LCD lit up
g.flip();
}
Expand Down

0 comments on commit 61fa3e7

Please sign in to comment.