I know its a little bit strange but this is what I need to do.
The code gets some string (*char or String), in the name "A0" or "A1"
Then I need to use this string to read the relevant analog - A0 or A1 accordingly.
so I can't just use the string as the pin name, and the only way I see is to use some conditions:
//pseudo
if( A0)
read A0
else if (A1)
read A1
Is there any other elegant way to do this directly using the strings names with some conversion ?
gil22:
I know its a little bit strange but this is what I need to do.
The code gets some string (*char or String), in the name "A0" or "A1"
Then I need to use this string to read the relevant analog - A0 or A1 accordingly.
so I can't just use the string as the pin name, and the only way I see is to use some conditions:
//pseudo
if( A0)
read A0
else if (A1)
read A1
Is there any other elegant way to do this directly using the strings names with some conversion ?