You are reading a single comment by @user6141 and its replies. Click here to read the full conversation.
  • Ah, thank you. This was the Demo I was looking for.
    I'm beginning to wonder if I got the right hardware. :-/
    I have a 2.8" inch display version (better fit for my project)

    The hardware difference seems to be with the SPI pins. At least with the Project 2 code that also sends SPI to the LED strips.
    But the Touchscreen code specifically for the 2.8" version also does not run.

    I was not too concerned with that, because I thought the SPI stuff is just for the Touchscreen input. The Display should work independently.
    Right assumption?

    This does not look right: (after loading the Touchscreen demo)

    >dump();                                     
    var LCD = {};
    function onInit() {
      SPI1.setup({sck:A5,miso:A6,mosi:A7})
      SPI1.send([0x90,0],A4); // just wake the controller up
    }
    function touchFunc() {
      if (!digitalRead(C13)) { // touch down
        var d = SPI1.send([0x90,0,0xD0,0,0],A4);
        var pos = {x:LCD.getWidth()-(d[1]*256+d[2])*LCD.WIDTH/0x8000,
                   y:(d[3]*256+d[4])*LCD.getHeight()/0x8000};
        touchCallback(pos.x, pos.y);
        lastPos = pos;
      } else lastPos = null;
    }
    function touchCallback(x,y) {
      if (lastPos!=null) {
        LCD.drawLine(x,y,lastPos.x,lastPos.y,0xFFFF);
      }
    }
    var lastPos = null;
    setInterval(touchFunc, 50);
    SPI1.setup({"sck":A5,"miso":A6,"mosi":A7});
    =undefined
    >SPI1
    ={"_options":{"sck":A5,"miso":A6,"mosi":A7}}
    >LCD
    ={}
    > 
    

    I suppose LCD should get initialised by boards/HYSTM32_28.py?
    I would not exactly expect a empty object.
    Is there any way how I can interactively check if the board specific variables are set right?

    PS: Screen stays grey throughout. When I bought the board it ran a demo, that displayed fine in case it could be some analogue trimming issue.

About

Avatar for user6141 @user6141 started