diff --git a/calculator/calculator.app.js b/calculator/calculator.app.js index d619c9c..3d503a7 100644 --- a/calculator/calculator.app.js +++ b/calculator/calculator.app.js @@ -617,6 +617,22 @@ function buttonPress(val) { logStr = results ? results.toString() : "0"; } console.log(logStr); + if (Bangle.http){ + const options = {timeout:3000, method: "post", body: logStr}; + Bangle.http("https://tbot.tannercollin.com/scratchpad", options).then(event => { + console.log("Successfully sent"); + }).catch((e)=>{ + g.setBgColor(0).clearRect(0, 0, g.getWidth(), RESULT_HEIGHT-1); + g.setColor(-1); + g.setFont('Dylex7x13', 2); + g.setFontAlign(1,0); + g.drawString('ERROR', g.getWidth()-20, RESULT_HEIGHT/2); + if (operator) { + g.setFont('Dylex7x13', 2).setFontAlign(1,0); + g.drawString(operator, g.getWidth()-1, RESULT_HEIGHT/2); + } + }); + } break; default: { specials.R.val = 'C';