A simple suggestion to a small problem

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.

Lots of similar suggestions (and something very close to yours) were discussed on the developers list. You should join if you've got a bit of time. The traffic isn't that heavy.

I'm not sure whether any consensus emerged but David Mellis, who would eventually have to make a decision on this, didn't act.

Perhaps he will summarize his views here.

paulb

While the current syntax may not be ideal, I haven't seen any proposals that were better enough to be worth the confusion of a change.

Although you know this, an addition like this would not change anything, but it would enable new users an easy comprehendable way of defining arduino pins.

Ofcourse, it is easy as it is now, I just got tired of explaining what an int is.

Thank you for the answer.