Ref the engineering port description: http://www.dexterindustries.com/GrovePi/engineering/port-description/
- In an Arduino sketch, analogRead(A0) is the same as analogRead(14). You can call grovepi.analogRead(0) or grovepi.analogRead(14)and you will get the same result.
- GrovePi sockets A0,A1,A2 use the AD converter and supportanalogRead() values 0-1023.
- GrovePi sockets D2-D8 are digital and support 1-bit input/output, values 0-1, using digitalRead() and digitalWrite().
- GrovePi sockets D3,D5,D6 also support Pulse Width Modulation (PWM) which means you can write 8-bit values 0-255 with analogWrite().
- Sadly you can’t use analogRead() with D3,D5,D6 and can only use it with A0,A1,A2 (aka D14,D15,D16).
- grovepi.analogRead() uses the above aliases so if you are trying to read a value from an analog sensor connected to D3, analogRead(3) will actually read from the 2nd pin on the A2socket.
I understand everything except for the last line. Why would analogRead(3) read from A2? I thought it would add 14 to it, but still, A3 or A17 neither is connected to anything useful as I understand it?