Nintendo DS Touchpad---> LED

hi! anyone knows how to control two leds (one would be X the other would be Y) with a nintendo ds touch pad? i'm very knew to this...i don't really know how to code, bue i know some electronics

thanks

Do you have the touch pad hooked up? Does it return proper values for X and Y? How do you want to control the LED with respect to X and/or Y? Brightness? Flashing speed? On at some value of X or Y?

This project of mine should help you: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1243499684/0

If you are wanting to control brightness of the LEDs on x and y (so at 0,0 they would both be off) then you want to map the x and y coordinates to 0-255 for the pwm output on the arduino. If you need any help with that then just say.

Mowcius

i just noticed that the breakout for the touchpad is shorting...

i'm trying to control the britness of two leds, but for now i'll have to wait for new breakouts

thanks :) i'll post something when i get the new ones

hi again! i allready have the breakouts and they look good!

so, i tryed to do the XY pad code, but it's not working here it is:

*/

int XsensorPin = 0; // select the input pin for the potentiometer int XoutPin = 9; // select the pin for the LED int XsensorValue = 0; // variable to store the value coming from the sensor

int YsensorPin = 1; // select the input pin for the potentiometer int YoutPin = 10; // select the pin for the LED int YsensorValue = 1; // variable to store the value coming from the sensor

void setup() { // declare the ledPin as an OUTPUT: pinMode(XoutPin, OUTPUT); pinMode(YoutPin, OUTPUT); }

void loop() { int XsensorValue = analogRead(XsensorPin) / 4; analogWrite(XoutPin, XsensorValue); int YsensorValue = analogRead(YsensorPin) / 4; analogWrite(YoutPin, YsensorValue); }

i'm alson wiring the touchpad like this: X1 to 5v Y1 to 5v X2 to analog in 0 and divided by a 10k resitor to ground Y2 to analog in 1 and divided by a 10k resistor to ground

can anyone se what am i doing wrong?

thanks

i forgot, the code was moded from the exemples page

I hate the example code that you used. There is no need to use restistors. See this page for some better code which definitely works:

http://mnicolato.altervista.org/arduino/ardtouch.htm

Use google translate as necessary!

Mowcius

Instead of doing analog/4 you want to find out what the range is (it will not be exactly 0-1023) and use the map function to map it within 0-255

http://www.arduino.cc/en/Reference/Map

Mowcius

humm...i'm a bit confused, how it is wired then? (google translator confused me even more)

is it: x1 and y1 to 5v and x2 to analog in 3 and y2 to analog in 4 ?

i tryed this and nothing happend :-/

is it: x1 and y1 to 5v and x2 to analog in 3 and y2 to analog in 4 ?

No...

Left: Digital 2 Top: Analog 3 Digital 5 Right: Analog 4 Digital 4 Bottom: Digital 3

You have to work out which the top, bottom, left and right are on the touchpad but it's not too difficult...

Mowcius

On the original DS touch screen (not DS lite):

//When looking at DS screen with connector bottom left they are in order going down as follows:

//TOP

//LEFT

//BOTTOM

//RIGHT

//

// Digital connections (used to drive power)

#define Lo 2 // LEFT to digital output 2

#define Bo 3 // BOTTOM to digital output 3

#define Ro 4 // RIGHT to digital output 4

#define To 5 // TOP to Digital output 5



// Analog connections (used to read the touch position)

#define Ti 3 // TOP also to analog input 3

#define Ri 4 // RIGHT also to analog input 4

It depends on which value you are attempting to find. I believe you should connect all 4 to seperate Digital I/Os, and then the Right and Top (?) to seperate Analog Inputs as well.

When attempting to find X, Set the Digital Right to HIGH, and the Digital Left to LOW, and then analogRead() the Top pin.

When attempting to find Y, Set the Digital Top to HIGH, and the Digital Bottom to LOW, and then analogRead() the Right pin.

Someone please correct me if I'm wrong :).

On the original DS touch screen (not DS lite)

What's the difference between the two?

What's the difference between the two?

As far as I know, it is just that the connector is in a different place but the pin connections may have changed order.

Mowcius

As far as I know, it is just that the connector is in a different place but the pin connections may have changed order.

Alright, because I was planning on buying this one off of eBay, and as far as I can tell, the pinout is still (from left to right) Top, Left, Bottom, Right.

What do you think? ;)

ok, and what do i conect to analog in 3 and 4?

sorry

Top: Analog 3 Digital 5 Right: Analog 4 Digital 4

// Digital connections (used to drive power)

// LEFT to digital output 2

// BOTTOM to digital output 3

// RIGHT to digital output 4

// TOP to Digital output 5

// Analog connections (used to read the touch position)

// TOP also to analog input 3

// RIGHT also to analog input 4

THERE!

;D

Alright, because I was planning on buying this one off of eBay, and as far as I can tell, the pinout is still (from left to right) Top, Left, Bottom, Right.

What do you think?

That'll work fine :D You can use any 4 wire resistive touch screen.

In theory you can also use any 5 wire resistive touch screen but don't ask me how!

Mowcius