Basically I am sending pin details from server so I am confused what values shall i send. So the pin number is given as a string which i am converting to int and passing to pinmode .
I can use a switch statment and use it select pin using any other character or number but i dont want to skip ahead without understanding it.
Sorry I am newby here.
So if i can know what is the number for a0 , a1,a2,a3 .
a4 a5 i am using for i2c so dont need for that.
Or if u can point me to a link or something would be a great help
When you say 'analog pin', you must say which one of the following two meanings you hold.
1. There are 6 analog pins (A0 - A5) on the UNO Board. By default, these pins are digital pins like other digital pins -- 2 to 13. As digital pins, the A0 - A5 have these undocumented DPin numbers: 14 to 19 and they can be used in the sketch. Now you can easily execute the following codes to set the direction of A0-pin as digital input line:
int pin = A0;
someMethod()
{
pinmode(pin,INPUT);
}
2. A0 - A5 pins/lines can be used to sample analog signals from external sources and route them to the internal ADC (analog-to-digital converter) of the MCU. This alternate service of the AX (A0 - A5) pin can be achieved by executing this instruction: analogRead(A0); as has been enunciated by @AWOL in Post#1. Now, A0-pin is no more a digital IO pin; its direction has been automatically changed to input mode.