Its only been 2 weeks since i have been starting to learn about arduino (through tutorials). After trying my hand at writing some sketches, some of these questions have been blocking my mind. I couldnt find the answers to any of these in the tutorials. please help me :-[
- i have seen in many example sketches that to assign a pin to a variable, programmers use 'int mypin = 0;'(alotting pin 0 to variable mypin, say) and for initialising a variable, they use 'int myvalue = 0;'(say). if both these statements are written in the same sketch then how would the compiler differentiate between a pin assignment and a variable assignment statement since both are exactly alike?
- if i am to use the digital pin '0' along with the 'analog in' pin '0' as input pins in a sketch for some reason, how would the compiler differentiate between which of these pins to be used for a digital input and which of them for an analoge input, considering the pin defining statements and the serial no. of the pins are exactly alike? would it differentiate through the read statements that follow these pins later in the sketch?
- can analog input pins from 0 to5 be read for digital values using digitalRead command and vice-versa?
- can we configure any of the digital pins from 0 to 13 as analog input pins in case we need to interface more than 6 analog sensors?