Pages: [1]   Go Down
Author Topic: Testing the Analogue ports  (Read 242 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Due to some dodgy wiring with my first project I managed to create some blue smoke so I am trying to test my Mega to see if it is still working properly. I have tested all the digital pins by editing Blink accordingly and all the pins responded as expected.

For the testing of the analogue ports I used the AnalogReadSerial sketch and registered a reading I could influence with the pot from 0-1023 on A0 but on A1-A14 I get a reading of 200-300 irrespective of the pot setting. Could someone please advise if that is normal?

Thanks.
Logged

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

In addition to moving the wire connected to the potentiometer's wiper, did you modify this line in the sketch to reflect the analog input you wanted to use each time?
Code:
  int sensorValue = analogRead(A0);

Sounds like you might have moved the wire, but it continued to read and report the reading from the (then disconnected) A0 pin.

Where did your blue smoke emanate from during your first project?

Cheers ! Geoff
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 33
Posts: 1926
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Your test approach is probably right for testing one board.

If you wanted to automatically test multiple Arduinos, see this on the http://ArduinoInfo.Info WIKI:

http://arduino-info.wikispaces.com/Arduino_Test

This tests both digital and analog pins, and the analog pins for digital operation as well.

Someday I'll source a test shield with all those resistors in neat Surface-Mount. 
Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

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

Thanks Geoff & Terry,

Geoff, you are spot on, I had not edited:
Code:
int sensorValue = analogRead(A0);
All the pins are responding so the blue smoke must have come from somewhere else although I am not sure where. I have replaced all the other components so I should be able to progress now.

Terry, it is just the single board I needed to check but an interesting resource you have pointed me towards.

Many thanks to both.
Logged

Pages: [1]   Go Up
Jump to: