You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Nice - thanks! You could definitely improve the Sharp Memory LCD library by the look of it - I don't have time to try an actual one here, but changing this in the existing library should work:

      g.flip = function () {
        digitalWrite(cs,1); // CS on
        spi.write([0b00000001,1]); // update, 1st row
        var w = g.getWidth()>>3, h = g.getHeight();
        for (var y=0;y<h;y++)
          spi.write(new Uint8Array(g.buffer,y*w,w),[0,y+2]); // pad and do 2nd row
        digitalWrite(cs,0); // CS off
      };
    

    Also any calls to spi.send could be spi.write - it doesn't try and read data so it never has to allocate anywhere to put the received data.

About

Avatar for Gordon @Gordon started