Quantcast
Channel: Arduino Forum - Latest topics
Viewing all articles
Browse latest Browse all 15317

Practicing Arduino Etiquette in programming?

$
0
0

Hello,
I have a general question about the exactness with which one would stay within Arduino etiquette as it pertains to programming syntax.

For example -
digitalWrite(PulseOut_Pin, HIGH) ;

This could simply be written as
PulseOut_Pin = 1;

For someone coming from a different MCU programming environment the latter would be more recognizable .

I'm wondering if an "Arduino only" programmer would be confused?

If one wanted to use PORTD of the Atmega328 as an 8-bit binary up/down counter or shift-register - one might write:

DDRD = B11111111; //Set PORTD all output
or
DDRD = 255; //Set PORTD all output

And then -
for (byte i=0; i<255; i++) PORTD = i; //increment PORTD

But I'm wondering if that syntax would be confusing to others within the Arduino community?

Sincere thanks

5 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 15317

Trending Articles