LCD_GRAPHICS_DRIVER (Clusso99) ILI9341
celtic3
Posts: 16
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
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.
Figured it out.
The values are being given in reverse of what i expected 0 right to 900+ left, also the values are higher than I expected. Feel like an idiot lol
The usual reason for that is because tabs and spaces are mixed differently on different lines. The forum's mono space is currently set at a tab-stop every four spaces.
Importantly, the compiler can be confused as to the intended indentation when tabs and spaces are mixed differently on different lines. Ensure either one or the other is used exclusively in your Spin source code.
@evanh @"Christof Eb."
Tabs and Highlight chat moved here: https://forums.parallax.com/discussion/comment/1560576/#Comment_1560576
If anyone interested ARCing function for
1.44in 128x128 ILI9163 color LCD.........4.00in 480x320 ST7796S color LCD.........2.4in & 3.2in 320x240 ILI9341 Touch LCD
XPT2046 Touch Panel support
LCD_Graphics_Driver = https://obex.parallax.com/obex/ili9341_xpt2046/
Circle (siz = scale of arc, ds = Degree start, de = Degree end, osx and osy = screen offset position, col = color)
You might want link to where the "lcd" source code lives.
Are you sure that this works? I thought QSIN and QCOS require the angle input to be 0..$1_0000_0000 for 0..360° instead of an integer number for degrees. Degrees as integer would be quite coarse, anyway.
yes it work for me?
Ah, I've just seen, there is a third parameter of 360 which defines what value is taken for a full circle. So yes, it works.