Latest firmware, kind of watch-like:
var initCmds = new Uint8Array([ 0xAe,0xD5, 0x80, 0xA8, 31,0xD3,0x0, 0x40,0x8D,0x14,0x20,0x01, 0xA1, 0xC8,0xDA,0x12,0x81,0xCF, 0xD9,0xF1,0xDb,0x40,0xA4, 0xA6,0xAf ]); var dc = D0; var cs = D2; var g = Graphics.createArrayBuffer(63,15,1,{vertical_byte : true}); var spi = new SPI(); spi.setup({mosi: 29 /* D1 */, sck:30 /* D0 */}); digitalPulse(D1,0,10);//rst cs.reset();dc.reset();spi.write(initCmds);delete initCmds;cs.set(); g.flip = function() { cs.reset();dc.reset();spi.write([0x21,0,127,0x22,0,7]);for (var i=0;i<4;i++) {spi.write(0xb0+i,0x00,0x12);dc.set();spi.write(Uint8Array(this.buffer,64*i,64));dc.reset();}cs.set();}; var n=0; function onSec() { var d=new Date();g.clear();g.drawString(d.getHours()+":"+d.getMinutes()+"."+d.getSeconds());g.flip();if (n++>10) {spi.write(0xae,cs);clearInterval();} } pinMode(D4,"input_pullup"); setWatch("clearInterval();setInterval(onSec,1000);n=0;spi.write(0xaf,cs);",D4,{edge:"falling",repeat:true});
Turns out 200 variables really isn't very much!
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Latest firmware, kind of watch-like:
Turns out 200 variables really isn't very much!