Shop OBEX P1 Docs P2 Docs Learn Events
LCD_GAPHICS_DRIVER (Clusso99) ILI9341 — Parallax Forums

LCD_GAPHICS_DRIVER (Clusso99) ILI9341

celtic3celtic3 Posts: 5
edited 2024-07-13 06:20 in PASM2/Spin2 (P2)

Having trouble trying to get the Touch screen to work proper. Using the following code it shows sporadic numbers for tx, ty. P2 edge card pin36 is the IRQ pin it is attached to on the ILI9341 screen..

if not pinr(36)
      tx        := lcd.get_ts($91)                                                      ' $91 turns off interupt and collects x position
      tempA   := lcd.get_ts($91)                                                         ' $91 keeps off interupt after x data, calibration point tx_topx
      ty        := lcd.get_ts($D1)                                                      ' $D1 keeps off interupt and collects y position
      tempA   := lcd.get_ts($D0)                                                         ' $D0 turns interupt back on after calibration point ty_topy

    lcd.drawString(8,180, "       ")
    lcd.drawString(25,180, cstr.dec(tx,3))
    lcd.drawString(8,190, "       ")
    lcd.drawString(25,190, cstr.dec(ty,3))

Could someone provide a snippet of how to go about this. Thank you

Comments

  • VonSzarvasVonSzarvas Posts: 3,323
    edited 2024-07-13 06:33

    Is the indenting in your actual code file as you need it to be?

    Thinking that might be worth checking because of the indentation shown in the code snippet above. Could just be the forum, or could be a clue!

    Ps. Added the code backticks for you, and removed the duplicate post. If you click the cog icon to edit your own post, you’ll see where the ticks are.

  • Thank you for the reply.
    The code indenting is fine, the forum changed it a little.

Sign In or Register to comment.