Drawing on ILI9341 y coordination mirror ?

Posted on
  • Using this code, it looks like y is starting from bottom not from top as it was before.
    String looks like being mirrored.
    Tested with last nightly build (1v62)

    var g,p,n,d;
    function firstDraw(){
      g.setBgColor(0.8,0.8,0.8);
      g.clear();
      g.setFontVector(24);
      g.drawString("Espruino",10,10);
      g.fillRect(40,40,100,100);
    }
    SPI2.setup({sck:B13, miso:B14, mosi:B15, baud: 1000000});
    g = require("ILI9341").connect(SPI2,C6,C7,C8­,firstDraw);
    
    
  • Hmm. Try g.setRotation(0,true) or g.setRotation(2,true).

    Not sure why it would just start doing it though :(

  • Tried rotation (from 0 to 3, true) with drawRect(0,10,20,30) and got:
    0: 219,10,239,30
    1: 209,299,229,319
    2: 0,289,20,309
    3: 10,0,30,20
    next tried rotation(from 0 to 3,false) with drawRect(0,10,20,30) and got:
    0: 0,10,20,30
    1: 209,0,229,20
    2: 219,289,239,309
    3: 10,299,30,319

    So, in my case setRotation(0,false) seems to be correct.

  • Interesting - just checked this and the default value for setRotation isn't initialised - so it can get filled with all kinds of stuff. 1v62 will have this fixed.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Drawing on ILI9341 y coordination mirror ?

Posted by Avatar for JumJum @JumJum

Actions