Go Down

Topic: (Solved) ITB01 shield touch flipped (Read 1 time) previous topic - next topic


Apr 12, 2013, 06:08 pm Last Edit: Apr 12, 2013, 10:37 pm by Tumbleweed Reason: 1
OK, I've wasted enough time on this, time to ask for help.
I purchased a ITB02 shield from Electrodragon and liked it because I could hack the SD pins so I could use I2C. Ordered another sheild/LCD set and it has changed to ITD01. The LCD works fine but the touch is flipped. The x coordinates are fine, just the y is upside down, not rotated.
I have looked a the .cpp and .h files in the UTouch library, but it is beyond my experience how to change it. They have a demo on the ElectroDragon site that works fine, but it doesn't use a library and I am not good enough programmer to code every pixel.
I have checked the pinouts used in my Utouch constructor against their demo and I think they are the same. There is a mention of CS being tied to ground now, but that doesn't seem to be the problem, to me anyway.
I have tried to find another source for the old ITB02 boards and not had much luck, they all seem to use the four shift registers to run everything.
I have searched here and Google for hours looking for a simple answer.
I tried to run the calibration test, but it jumps past the instruction screen, thenshifts back and forth from the Hold to the Press screens to fast for the eye to see. Like something is pressing on the screen.
Here are all the (I hope) relevant links and my constructor code from example Touch_button_test.
LCD http://www.electrodragon.com/?product=itdb02-2-4-tft-lcd
Sheild http://www.electrodragon.com/?product=itdb02-2-4-tft-lcd-arduino-adapter-shield
schematic of shield http://elecfreaks.com/store/download/datasheet/shield/schematic-2.4-v2.pdf
demo code http://elecfreaks.com/store/download/datasheet/shield/TFT2.4-Shield-v2.zip
Utouch Lib http://henningkarlsen.com/electronics/library.php?id=55
UTFT lib http://henningkarlsen.com/electronics/library.php?id=51
Relevant code from the demo in UTouch
Code: [Select]
// UTouch_ButtonTest (C)2010-2012 Henning Karlsen
// web: http://www.henningkarlsen.com/electronics
// This program is a quick demo of how create and use buttons.
// This program requires the UTFT library.
// It is assumed that the display module is connected to an
// appropriate shield or that you know how to change the pin
// numbers in the setup.

#include <UTFT.h>
#include <UTouch.h>

// Declare which fonts we will be using
extern uint8_t BigFont[];

// Uncomment the next two lines for the Arduino 2009/UNO
UTFT        myGLCD(ITDB24E_8,19,18,17,16);   // Remember to change the model parameter to suit your display module!
UTouch      myTouch(15,8,14,9,8);
         //tclk,tcs,din,dout,irq   these are the pinout orders

ElectroDragon chat room says they will work on it, but it should be working.


So simple no wonder nobody answered.
Just subtracted Mytouch.getY function output from 240, which reversed y value.
Now to try it in my own sketches.
Code I changed from example.
Code: [Select]
void loop()
  while (true)
    if (myTouch.dataAvailable())
      y=240 -(myTouch.getY());
      if ((y>=10) && (y<=60))  // Upper row
        if ((x>=10) && (x<=60))  // Button: 1
          waitForIt(10, 10, 60, 60);
Einstein once said you don't really understand anything until you can explain it to your Grandmother

Go Up