Pages: 1 [2] 3 4 5   Go Down
Author Topic: utouch ssd1963 5 inch problem  (Read 4880 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I Hope You Can Help i know alot have The same problem
Logged

France
Offline Offline
God Member
*****
Karma: 29
Posts: 898
Scientia potentia est.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe orientation problem, try change
Code:
#define TOUCH_ORIENTATION  PORTRAIT
to
Code:
#define TOUCH_ORIENTATION  LANDSCAPE
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Its not The orientation the touch library is only scaled for 320x240
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What does x,0,0,0,0 mean here wich cordinates so i set where?

Code:

  tx = map( X, 0, 3550, 0, 239); // the screen data for X
  ty = map( Y, 0, 4860, 0, 319); // the screen data for Y
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 65
Posts: 2921
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What does x,0,0,0,0 mean here wich cordinates so i set where?

Code:

  tx = map( X, 0, 3550, 0, 239); // the screen data for X
  ty = map( Y, 0, 4860, 0, 319); // the screen data for Y

that is the map function, it works like this.
mapped output = map( your inputted data, lowest value of the data, highest value of data, lowest value you need, highest value you need)
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Queens, New York
Offline Offline
Faraday Member
**
Karma: 65
Posts: 2921
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just updated my sketch in reply #11, try it
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i got it working but when i move on the screen the number goes from 100 til 990 and then starts from 100 and goes up til 500 on the x axis shouldi take this numer as 1500??
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 65
Posts: 2921
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you looking at the raw data or mapped data? The thing about maps is, they do not stay in range. meaning if your Highest value is say 500, and the map goes over that, it will give you unwanted results.
they way to fix this is by using a constrain.

constrain(tx, lowest mapped value, highest mapped value);
constrain(ty, lowest mapped value, highest mapped value);
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

so finaly go it calibratet i think yousing the serial.print funktion but a new problem the x and y axis is invertet:/
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 65
Posts: 2921
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Post your full code and I'll take a look at it.
« Last Edit: May 12, 2013, 01:21:57 am by HazardsMind » Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

its always been a broblem that the x and y axis whas ivertet no mater what eksamlpe i use from utouch

// UTouch_QuickDraw (C)2010-2012 Henning Karlsen
// web: http://www.henningkarlsen.com/electronics
//
// This program is a quick demo of how to use the library.
//
// 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>
#define TOUCH_ORIENTATION  LANDSCAPE

// Uncomment the next two lines for the Arduino 2009/UNO
//UTFT        myGLCD(ITDB24D,19,18,17,16);   // Remember to change the model parameter to suit your display module!
//UTouch      myTouch(15,10,14,9,8);

// Uncomment the next two lines for the Arduino Mega
UTFT        myGLCD(SSD1963_800, 38,39,40,41);   // Remember to change the model parameter to suit your display module!
UTouch      myTouch(6,5,4,3,2);
int val;
int tx;
int ty;
void setup()
{
  Serial.begin(9600);
  myGLCD.InitLCD();
  myGLCD.clrScr();

  myTouch.InitTouch();
  myTouch.setPrecision(PREC_MEDIUM);
}

void loop()
{
  long x, y;
  val = (myTouch.dataAvailable() == true);            // reads the value of the potentiometer (value between 0 and 1023)
  val = map(val, 0, 479, 0, 799);
  while (myTouch.dataAvailable() == true)
  {
    myTouch.read();
    x = myTouch.getX();
    y = myTouch.getY();
   
    tx = map( x, 0, 291, 0, 491); // the screen data for X
    ty = map( y, 0, 145, 0, 261); // the screen data for Y
   


    {
      myGLCD.drawPixel(tx, ty);
    }
  }
}
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24284
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
val = (myTouch.dataAvailable() == true);   
That's going to return a very limited range of values, isn't it?
Why bother mapping?

After nearly 40 posts now, do you think you could start using code tags?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Queens, New York
Offline Offline
Faraday Member
**
Karma: 65
Posts: 2921
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is not doing anything.
Quote
  val = (myTouch.dataAvailable() == true);            // reads the value of the potentiometer (value between 0 and 1023)
  val = map(val, 0, 479, 0, 799);

Your map looks like you guessed on the numbers, but I'm not surprised because your not printing the data to the LCD like I showed you how to do.

Go back and re-upload the code I gave you, I added more to it from the first time I posted it, and I wrote after that post, that I made changes to it.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

how should i take the readings and put them is it like pressing left top orner and putting it in
when i touch top left corner it says

y: 0x000000E6UL
x: 0x000000ABUL

where and how smiley-sad

i dont now how to put in the data
« Last Edit: May 12, 2013, 01:39:24 pm by nonamejohn » Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 63
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I hate to bring this back up again.  But I am dealing with the same problem.  I am using those same libraries.  The display only reads an X_touch and Y_touch of 320x240.  So clearly the screen is not mapped properly.  I attempted to use the sketch in reply 11 as suggested seeing as how it was noted that changes have been made to it multiple times.  Nothing appears on my screen.  This, however, is after I declared: long tx and long ty.  The compiler says these were not declared.  Regardless, nothing is happening.  What should I be expecting to see?  How can I fix the mapping?
Logged

Remember remember, the 4th of...July!  Duh.

Pages: 1 [2] 3 4 5   Go Up
Jump to: