Nintendo DS ToushScreen: why "y" is alwa

Hi,

i have connected a Nintendo DS TouchScreen to my Arduino duemilanove and i’m able to get only the x axis value, while the Y value is always 0 (zero).

Naturally i have read a lot of stuff on the web and tried a lot of scripts and connections (i’m not so good in electronic stuff so I often get inspiration from web) and it seems other people had the same problems.

Following the last source code I used :

//modified to match my sparkfun connector
#define xLow  17
#define xHigh 15
#define yLow  16
#define yHigh 14
 
 
void setup(){
  Serial.begin(9600);
}
 
void loop(){
  pinMode(xLow,OUTPUT);
  pinMode(xHigh,OUTPUT);
  digitalWrite(xLow,LOW);
  digitalWrite(xHigh,HIGH);
 
  digitalWrite(yLow,LOW);
  digitalWrite(yHigh,LOW);
 
  pinMode(yLow,INPUT);
  pinMode(yHigh,INPUT);
  delay(10);
 
  //xLow has analog port -14 !!
  int x=analogRead(yLow -14);
 
  pinMode(yLow,OUTPUT);
  pinMode(yHigh,OUTPUT);
  digitalWrite(yLow,LOW);
  digitalWrite(yHigh,HIGH);
 
  digitalWrite(xLow,LOW);
  digitalWrite(xHigh,LOW);
 
  pinMode(xLow,INPUT);
  pinMode(xHigh,INPUT);
  delay(10);
 
  //xLow has analog port -14 !!
  int y=analogRead(xLow - 14);
 
    Serial.print(x,DEC);   
    Serial.print(",");     
    Serial.println(y,DEC); 
 
  delay(200);
}

Connections
I used four 10K resistors connecting every pin to ground
A0 → x1
A1 → y2
A2 → x2
A3 → y1

Thanks in advance
Fabio

I'm no expert, but maybe you should check out this thread:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1243499684

for wiring information and programming info..

Yep, I was going to post you to my thread as well :smiley:

The original page I used code from may also help you:

http://translate.google.co.uk/translate?hl=en&sl=auto&tl=en&u=http%3A%2F%2Fmnicolato.altervista.org%2Farduino%2Fardtouch.htm
If that code does not want to work then you have your connections wrong!

Any more questions, just ask :smiley:

Mowcius

thanx guys! :slight_smile:

I had already tested and read these links too but if you are 100%sure that it works I'll try them again :slight_smile:

Are you? Please, be honest : D

Fabio

Yep, I am sure that the basic code from marco nicolato works right out the box becuase I have used it like that. Try his code, you don't need any resistors/ it is simpler :wink:

Hope you get it working...

Mowcius

Thanx a lot mowcius, i'll do my best : )