![]() ![]() ![]() ![]() ![]() Alan numitron clock Clapclap 2313/1386 SNES Pi Webserver USB Volume/USB toys Smokey amp Laser cutter WordClock ardReveil v3 SNES Arcade cabinet Game boy projects cameleon Home Presence Detector ![]() AlanFromJapan ![]() ![]() ![]() Akizukidenshi Elec-lab Rand Nerd Tut EEVblog SpritesMods AvrFreaks Gameboy Dev FLOZz' blog Switch-science Sparkfun Suzusho Datasheet Lib Reddit Elec Ermicro Carnet du maker (fr) |
Arduino and a Nintendo DS touch screenLast update: Thu Jun 5 22:25:40 2025
![]() ![]() Realisation![]() Quite easy to do, with inexpensive components (Touch screen is 10$, break board connector 4$ and just buy it, don't be a hero), but with one or two caveats. Sample, wiring and code here under. Everything is basically an application of Elm-chan's very good tutorial http://kousaku-kousaku.blogspot.com/2008/08/arduino_24.html (but not in Japanese). You might be interrested in a project I did that uses it, it's the ardReveil. I divided the touchpad in 4 zones in/out/%20/- and used it as an input and it was quite successful. Project had other problems but at least this was really ok. Caveats and what you should know
Pictures![]() Too many people use this, too few put a diagram. I suck a electronic, so I put a graph. One important word : 4x 10kOhm can't be replaced with just one, don't waste time trying. ![]() With the 10 kOhm resistors, nice reading, no recalibration : raw results drawn on a 800x800 picture. Life is great. BEWARE: this pin assignement is according the code here under. If you have other assignement, just change the constants in the header of the Arduino code. ![]() Arduino 2009 %20 4x 10 kOhm %20 Connector %20 DS touch screen. You can do that within 1 hour for sure... LinksShopping
Documentation and tutorials
Reading values
Calibration (no need with 10kOhm pull down)
Code
Taken from http:kousaku-kousaku.blogspot.com/2008/08/arduino_24.html /* #define xLow 14 #define xHigh 15 #define yLow 16 #define yHigh 17 */ //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); } |
All content on this site is shared under the MIT licence (do what u want, don't sue me, hat tip appreciated) electrogeek.tokyo ~ Formerly known as Kalshagar.wikispaces.com and electrogeek.cc (AlanFromJapan [2009 - 2025]) |