I just wanted to share a simple line of code that I've found helpful to those new to programming, intuitively understanding arduino code.
I am refering to one little word that always is the reason for the first question. And it is 'int'
For all of you with english as your first language this might seem odd, but the word 'integer' is not thought to us that learn english as an additional language (there might be some exceptions ofcourse but I've never seen it being used instead of number, for instance.)
I propose the following (being added to wiring.h ?):
typedef const byte pin;
It results in the following blink sketch:
pin ledPin = 13; // LED connected to digital pin 13
void setup() // run once, when the sketch starts
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}void loop() // run over and over again
{
digitalWrite(ledPin, HIGH); // sets the LED on
delay(1000); // waits for a second
digitalWrite(ledPin, LOW); // sets the LED off
delay(1000); // waits for a second
}
All of those who I've asked have intuitively predicted what this sketch does, without any questions.