diff --git a/apps/gbaudioc/gbaudioc.js b/apps/gbaudioc/gbaudioc.js index 1a2ea841c4..b58921b32c 100644 --- a/apps/gbaudioc/gbaudioc.js +++ b/apps/gbaudioc/gbaudioc.js @@ -1,26 +1,39 @@ 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() { @@ -28,7 +41,7 @@ function display() { 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(); }