Hello,
I'm still waiting for a certain Arduino kit to be back in stock so I don't have one yet, but I'm playing with the compiler and learning the software anyway even without one.
I'm trying to understand how the compiler "knows" which pin is which and what it's supposed to to. I have tried typing the wrong variable names and the compiler understands that there is an error - for example it doesn't accept high but does accept HIGH for a digital output. But it doesn't seem to have the same smarts about the pins and the variable assigned to them. Maybe it makes sense to someone out there though. I have an example that compiles with questions inserted, if anyone could help me understand this aspect I'd appreciate it.
void setup() {
}
void loop() {
int sensorValue = analogRead(44000); //why does this function accept 44000 as the pin # when there is no such pin?
int digital = digitalRead(A0); //Why does digitalRead accept an analog pin variable (A0)
digitalWrite(0,34770); //why does digitalWrite accept a number and not the variable HIGH or LOW?
//What does the number mean in this case?
analogWrite(8,100); //why is this accepted when pin 8 is not PWM capable?
}
Thanks.