Pages: [1]   Go Down
Author Topic: Would I use analogRead to incorporate a joystick?  (Read 304 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know it sounds like a stupid question but I'm new.
 
I'm trying to use a N64 controllers joystick to trigger a dc motor.

I'm not exactly sure where to begin and if someone could give me a little example or point me in the right direction I would really appreciate it.
Logged

Greenville, IL
Offline Offline
Edison Member
*
Karma: 15
Posts: 1328
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


 Take a look at this link and if you need more help let us know.

http://www.instructables.com/id/USB-NES-controller-with-an-arduino/
Logged


Offline Offline
Faraday Member
**
Karma: 80
Posts: 3785
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I can't speak for that model specifically, but joysticks like this one are just two potentiometers at right angles. So each axis can indeed be read through an analog pin with code like this.

HTH?
Logged

Although I answer in good faith, remember always: Your Mileage May Vary.
Get me on LinkedIn: za.linkedin.com/in/jimbrownza/

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That is what figured because there are 2 sets of wires coming from it.

What does HTH mean?
Logged

Poole, Dorset, UK
Offline Offline
Edison Member
*
Karma: 50
Posts: 2194
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

AnalogRead() is good for the joystick its self. But for any buttons you will need digitalRead().

Mark
Logged

Offline Offline
Faraday Member
**
Karma: 80
Posts: 3785
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What does HTH mean?

Hope That Helps......
Logged

Although I answer in good faith, remember always: Your Mileage May Vary.
Get me on LinkedIn: za.linkedin.com/in/jimbrownza/

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, so I looked up the Nintendo 64 controllers->http://en.wikipedia.org/wiki/Nintendo_64_controller and according to wikipedia, they dont use a normal potentiometer. They use a light and light sensor to get the position of the switch.

I took apart an old controller, took out the joystick and the "potentiometer" controlling it, and wired to a dc motor. When its all the way down, no power. And as you twist it hits a hot spot in the middle then goes to about half power when all the way up (If that makes sense).

Also i checked out using the NES controller, is the any tutorial for a 64 controller?
Logged

Pages: [1]   Go Up
Jump to: