Loading...
Pages: [1]   Go Down
Author Topic: Nintendo DS ToushScreen: why "y" is alwa  (Read 252 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 :

Code:

//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
« Last Edit: November 22, 2009, 09:00:13 am by flagers » Logged

B0100111001000011, USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1503
I'm confused.  Wait, maybe not..
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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..
Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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-grin

Mowcius
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanx guys! smiley

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

Are you? Please, be honest : D

Fabio
Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-wink

Hope you get it working...

Mowcius
« Last Edit: November 22, 2009, 05:09:55 pm by mowcius » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Print
 
Jump to: