Some pins do not work with
digitalRead, or
digitalWrite. These pins don't have conventional digital pin numbers, only analog pin number (i.e. they begin with an
A). On the 3.5/3.6, these pins are:
- Pins A10 & A11 (inner through hole pins, next to pins 22 and 23);
- Pins A21 & A22 (outside, between the middle ground pin and pin 39) -- note these pins can do a true analog output (DAC) as well as analog input (they can be used to emit stereo sound using amplification);
In addition, the 3.5 has two additional analog input pins (A25 and A26) that are in the second inner through hole row by pins 2 and 3. The 3.6 puts the USB host pins there, but the 3.5 doesn't have support for the USB host, but instead has 2 more analog input pins.
Except for the two DAC pins (A21 and A22 on the 3.5/3.6, A14 on the 3.1/3.2, A12 on the LC),
analogWrite is mis-named, and it should be called something like
PwmWrite. The analog output is done by turning the pin on/off rapidly, so that the sum of the voltage will be between 0 and 3.3v. This works for LEDs, but it isn't as useful for sound output where you want the voltage to be actually changing instead of turning the pin on/off. The DAC pins can vary the voltage (between 0 and 3.3v or 0 and 1.2v IIRC, depending on the settings).