Twinscroll
Active member
Hi.
I have a strange issue with my 320 x 240 - 2.8" ILI9341 Touchscreen display and was wondering if anyone may have any ideas as to what may be at the route of the issue!
In summary as per the title of this thread, The values being reported for the touch location of "X" and "Y" - are intermittently swapping places.
Below is a small extract from a serial dump of the X and Y positions.
I am keeping my finger in the same place on the screen, but notice the middle line where X and Y have flipped.
X = 855 Y = 2863
X = 860 Y = 2876
X = 2853 Y = 864
X = 855 Y = 2881
X = 857 Y = 2863
This Swap of position is only brief, but it is causing me a headache on my project, as on my final code I am drawing a 'virtual' line down the middle of the screen and use the value of X to either show the "next" screen, or to show the "previous" screen data. i,e as a menu / screen select control.
My hardware setup is a Teensy 3.1 and I am using the Micro SD card on Pawelsky's CAN bus board - https://goo.gl/byHlgs
The SD card initialises every time and the SD card logs fine, so I dont think this is directly hardware related.
I am not sure but there appears to be something undesirable happening between the SD and Touch when using the SPI bus?
My final project code is quite large & still in progress but in order to show this issue (or at least it looks to be the same) - I have updated the Touchtest.ino example code to include the SD card and show the same Intermittent issue (this is what I used to gather the example data above).
View attachment Touch_and_SD_Card_Cutdown_Code.ino
Note in the main loop of the attached Touch_and_SD_Card_Cutdown_Code.ino code example -
// Once this Section of Code is introduced the Intermittent X and Y flipped begins.
/*
myFile.print(p.x); // Write To SD Card
myFile.print(","); // Write to SD Card
myFile.println(p.y); // Write to SD Card
*/
// Note currently for the purpose of simplifcaiton on this cut down code the SD card is not Closed or Sync'd / Saved.
On my end application the user is not holding their finger on the screen constantly, but I do make regular writes to the SD card (Including a Sync ~ every 1 second).
I was finding some very odd behaviour and found the X & Y swapping to be at the route of the issue.
Does anyone have any thoughts or suggestions what I might be able to try?
Currently on my final code, I am reading the position of X multiple times and taking an average of the readings, but this is not 100% reliable, and is only a workaround.
Can anyone else try and recreate this issue?
Best Regards
TS
I have a strange issue with my 320 x 240 - 2.8" ILI9341 Touchscreen display and was wondering if anyone may have any ideas as to what may be at the route of the issue!
In summary as per the title of this thread, The values being reported for the touch location of "X" and "Y" - are intermittently swapping places.
Below is a small extract from a serial dump of the X and Y positions.
I am keeping my finger in the same place on the screen, but notice the middle line where X and Y have flipped.
X = 855 Y = 2863
X = 860 Y = 2876
X = 2853 Y = 864
X = 855 Y = 2881
X = 857 Y = 2863
This Swap of position is only brief, but it is causing me a headache on my project, as on my final code I am drawing a 'virtual' line down the middle of the screen and use the value of X to either show the "next" screen, or to show the "previous" screen data. i,e as a menu / screen select control.
My hardware setup is a Teensy 3.1 and I am using the Micro SD card on Pawelsky's CAN bus board - https://goo.gl/byHlgs
The SD card initialises every time and the SD card logs fine, so I dont think this is directly hardware related.
I am not sure but there appears to be something undesirable happening between the SD and Touch when using the SPI bus?
My final project code is quite large & still in progress but in order to show this issue (or at least it looks to be the same) - I have updated the Touchtest.ino example code to include the SD card and show the same Intermittent issue (this is what I used to gather the example data above).
View attachment Touch_and_SD_Card_Cutdown_Code.ino
Note in the main loop of the attached Touch_and_SD_Card_Cutdown_Code.ino code example -
// Once this Section of Code is introduced the Intermittent X and Y flipped begins.
/*
myFile.print(p.x); // Write To SD Card
myFile.print(","); // Write to SD Card
myFile.println(p.y); // Write to SD Card
*/
// Note currently for the purpose of simplifcaiton on this cut down code the SD card is not Closed or Sync'd / Saved.
On my end application the user is not holding their finger on the screen constantly, but I do make regular writes to the SD card (Including a Sync ~ every 1 second).
I was finding some very odd behaviour and found the X & Y swapping to be at the route of the issue.
Does anyone have any thoughts or suggestions what I might be able to try?
Currently on my final code, I am reading the position of X multiple times and taking an average of the readings, but this is not 100% reliable, and is only a workaround.
Can anyone else try and recreate this issue?
Best Regards
TS