This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("Font8x12").add(Graphics); | |
// List of devices | |
var devices = []; | |
// For each device discovered | |
function onDevice(dev) { | |
// work out the temperature | |
var info = { | |
id : dev.id.substr(0,17), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var KB = [ | |
'QWERTYUIOP[]', | |
'ASDFGHJKL;\'#', | |
'\\ZXCVBNM<>/ ']; | |
var KBX = 3; | |
var KBY = 160; | |
var KBS = 20; // key spacing | |
var KBR = 16; // key size | |
var keyx = 0, keyy = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g.clear();g.setFont("Vector",24); | |
for (var y=0;y<16;y++) { | |
for (var x=0;x<16;x++) { | |
g.drawString(String.fromCharCode(x+y*16),x*32,y*32); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://emergent.unpythonic.net/software/hershey | |
var hershey = `12345 1JZ | |
12345 9MWRFRT RRYQZR[SZRY | |
12345 6JZNFNM RVFVM | |
12345 12H]SBLb RYBRb RLOZO RKUYU | |
12345 27H\\PBP_ RTBT_ RYIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX | |
12345 32F^[FI[ RNFPHPJOLMMKMIKIIJGLFNFPGSHVHYG[F RWTUUTWTYV[X[ZZ[X[VYTWT | |
12345 35E_\\O\\N[MZMYNXPVUTXRZP[L[JZIYHWHUISJRQNRMSKSIRGPFNGMIMKNNPQUXWZY[[[\\Z\\Y | |
12345 8MWRHQGRFSGSIRKQL | |
12345 11KYVBTDRGPKOPOTPYR]T\\\`Vb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Binary search keyboard for typing with | |
the touchscreen | |
*/ | |
var storage = require('Storage'); | |
const settings = storage.readJSON('@setting') || { HID: false }; | |
const KEY = { | |
A : 4 , |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bangle.setLCDMode("120x120"); | |
var vs2 = function(x,y,x2,y2,p) { // vertices for for chk like shapes ('beveled') corners | |
// 4 'beveled corners' = 8 corners defined by 0 and p insetting combinations for x, y | |
return [x,y+p, x+p,y, x2-p,y, x2,y+p, x2,y2-p, x2-p,y2, x+p,y2, x,y2-p]; }; | |
function onInit() { | |
`prep display` | |
g.clear(); setTimeout(()=>{ | |
g.setColor(0); | |
g.fillRect(0,0,127,63); // canvas (color 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var model=atob("GAAAAFRGTDMAAA4AGAAEAAgADAAQABQADgAAAAMAAADsCQAAuAUAAKAFAAAEAAAACwAAAJAFAAB8BQAAJAUAANQEAADMBAAAxAQAALwEAABsBAAAXAAAAAwAAAAEAAAAePb//7b6//8EAAAAQAAAAJ4IZD5QVk0+7cXIPkq+Er8xYmi8i2/MPqSmNL4qZ529BkrJPsPwij08RhC/GISaPuFzVD5EElI+BF7yvgBVWz4C+///BAAAAAAEAADy1BE+hO4/PpbYQL5lm62+Of0OvqzJgT6emCU+N++UvGqNxr4E0iC+4KYUPWwbhb5x7CC9a6WBPqhwhb5h/qw+nsY4vtWAXb6Mjwa8fL+nPfqwjj4yjtU8vxOaPpw0Tj643ZQ+dEUkPCglib1csyS+V3pqPm3mj75NqYs+sw0xPucVkb4sMBm+Fy3DPbxymL3qREg+7ZoVvowzlz0K6sm+lNNoPmBunr2AD6i8St+MvgJSlD4awpw+1JWxvhaUv7xropi+lvRdPX9dkr6rZKy+rv/LPngF7L5YDX89OhGdPl5g1L5tvj2+4Ol1PQZm273xFcM9Gyq0PnMCuD4kpDy/kV5svk89SD/TlMY9fCvWvo7gej1gHou/MkCCvmLRGD++MdG7ugULv/cOhL74yme/w3mIvVy3jT2/a6k+MgrFvqiPzb1Hgt49c3a5PiUNWL5SGq4+0RRvPnKPKT6wWhw/F4r3PS0LyrwP4dy+snCYPuusFb6D8AW/FpNrvuegab4q+Mk+NoaZPiCL4b2HZLg+7/csvhoWKLwUMh6+xI8OPnLyqj7oXFk+nJrPPS/Hwz7taiC+aPmHvhXdwL4OATa+ui26PfVEVD5ZaKQ+pQq/vqB3gz0sESU+c3e+vnfT6j05v2i+jyi6vsD2gr4vEFG9RfnSvtxRFb+YV7G+Q9ZiPsFggL/waZa+nK12vhExuj5gUCQ/0FmlPeTUkL4MUQk/s0jOvRxroj0IU+q97BiUvhZEtz5mrL2/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This is a simple T-Rex JavaScript game | |
for the Bangle.js smartwatch. | |
Check it out on: | |
https://www.kickstarter.com/projects/gfw/banglejs-the-hackable-smart-watch | |
You're seeing T-Rex's JavaScript running in an | |
emulated version of the Espruino JavaScript | |
interpreter, compiled with emscripten and | |
running in JavaScript directly on your web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<a onclick="go()">Click me</a> | |
<script> | |
function go() { | |
var options = { | |
filters: [ | |
{name: 'ENV'}, | |
] | |
}; |