Tutorial problems

Just going though some of the tutorials on the Arduino Tutorial page (4. Communication) and I keep running into a problem.

All I am doing is setting up the physical connections and copy/pasting the code. So far Graph, Virtual Color Mixer, and Serial Call and Response (handshaking) all are giving me "error: 'A0' was not declared in this scope" in the Arduino IDE. Please for the love of god tell me what I am missing before I lose it!

You probably have bad code you need to fix.

I would agree with that, however, I am copying and pasting from the arduino.cc site.

Try replacing A0 with just 0

Thank you, it works now.

Hopefully someone from the site reads this and fixes it.

Which version of the IDE do you use?

Hopefully someone from the site reads this and fixes it.

Do you also believe in the tooth fairy?

Don

Hopefully someone from the site reads this and fixes it.

It is fixed if you use the latest IDE, starting in (I think) version 20 ten A0 was a predefined constant to be equal to 0. If you are using an old version of the software with the new version of the tutorial you only have yourself to blame.

In WProgram.h, the An const values are the values of the analog pins when used as digital pins. For the non-Mega, A0 is assigned a value of 14. For the Mega, it has a value of 54.

Whoever modified all the tutorials to use An names screwed up when the context is specifically related to analog pins.