Problem reading analog inputs with nano



joystick - nano
GND - GND
+5V - +5V
VRX - A0

And here's the code :

void setup(){
  Serial.begin(9600);
}
void loop(){
  Serial.println(analogRead(A0));
  delay(100);
}

Hi,
Move the A0 from VRX to VRY.
See if the joystick movements show up then.

Have you tried reconfiguring to A1?

Do you have a DMM? Digital MultiMeter?

Thanks.. Tom.... :grinning: :+1: :coffee: :australia:

Looks pretty straightforward - I was expecting to see a breadboard, or rats nest, but you've kept it to the minimum(you'd be surprised what we see when we get photos, sometimes).

Have you tried with a brand-new jumper set(have to ask)? Those Dupont connectors wear out quickly.

OT - Did you solder this one? Looks really good. The only pin(of those I can see) that might need a reheat is the 'blobby' pin D11, and that's not related to what we're discussing. Otherwise, good job!

Puzzling. I'm out of gas, otherwise.

tried both, doesnt work

im thinking of trying it out on a breadboard.

P.s. Yeah, i soldered it this time too. Thanks for the complements

There's something fishy here. "known good joystick", "known good Arduino", should not result in "does not work" with the device wired as shown. Forgive me, but you didn't answer - did you change the jumpers?

Can you post a sample of the output you are getting?

Hi, @ac-rafi

Can you please try this.
Disconnect the joystick.
The do these 3 tests.

Connect A0 to GND, see what you get in the monitor.
Connect A0 to 3V3 pin and see what you get in the monitor.
Connect A0 to 5V and see what you get in the monitor.

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:

Getting expected values :

  1. 0
  2. 1023
  3. around 650

Hi,
Thanks for that.
Have you measured the resistance between gnd and 5V on the joystick?

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:

how to do that?

Hi, @ac-rafi

Do you have a DMM? Digital MultiMeter?

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:

yes i do

Use it in OHMS mode and measure the resistance between 5V and gnd pins on the module.

Tom.. :grinning: :+1: :coffee: :australia:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.