You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • 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,{vert­ical_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();sp­i.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(on­Sec,1000);n=0;spi.write(0xaf,cs);",D4,{e­dge:"falling",repeat:true});
    

    Turns out 200 variables really isn't very much!

About

Avatar for Gordon @Gordon started