rgPaiva:
I already did it, but it only shows 1023...
So you are saying that even running a wire from A0 to ground you are getting 1023? Are you connecting a wire from A0 to the GND port on the Mega directly?
If so something is wrong. Even if there is a short running it directly to ground should bring it down.
Is your Mega sitting on top of a metal table or something? There are no shields installed right?
Yes i connected a wire from A0 to GND directly too, and tried the ReadAnalogVoltage program, but it shows only 5v. And i havent tried the 54 digital pins , only the pwn outputs, but i think the problem is with the ATMega2560 ;/. And it doesn't have any shield on it, and i am using it on wood table.
rgPaiva:
Yes i connected a wire from A0 to GND directly too, and tried the ReadAnalogVoltage program, but it shows only 5v. And i havent tried the 54 digital pins , only the pwn outputs, but i think the problem is with the ATMega2560 ;/. And it doesn't have any shield on it, and i am using it on wood table.
What about the other analog pins? Did you try A1-A5?
Sorry it was the digital 9 next to the pwm. I used the digital pin 9 to the example AnalogInOutSerial, but the led got the 5v all the time.
You're on the wrong side of the board. The PWM pins are output only. Reading an analog value is done on the analog pins. The ones on the other side of the board.
Sorry it was the digital 9 next to the pwm. I used the digital pin 9 to the example AnalogInOutSerial, but the led got the 5v all the time.
You're on the wrong side of the board. The PWM pins are output only. Reading an analog value is done on the analog pins. The ones on the other side of the board.
Yes... and thats why i used the AnalogInOutSerial example that come with arduino 1.0 ide. Using the led at port 9...