Pin Assignments

Hello, Is it better to define pins as...

int redLed = 5;

or

#Define redLed 5

I'm using all the IO inputs on the arduino and I'm starting to worry about memory. I'm under the impression that using the #defines uses less memory as it passes just the value to the compiler? Thanks!!

This topis has been discussed over and over.Time for you to do some searching.

The differences in memory usage are minimal. You can save half of it by making the pin number variables byte, instead of int. Unless you've got more than 255 pins, that is.

I'd go for "const int", mostly because "#Define" won't compile. ;)

@PaulS - I was indeed being lazy! @ AWOL - const int it is. Thanks guys - just trying to do things the correct way and make my code as readable as possible!