Krupski:
stoopkid:
Why do we use:int led = 13;
instead of
byte led = 13;
If you would never need to define more than 256 pins, why use the extra space for int? Is there a reason?
Thanks.
A "byte" type is the same as "uint8_t" (uses one byte of memory). An "int" is an unsigned 16 bit variable (uses two bytes of memory).
For constants like "led = 13", why not just use
#define led 13
?
Because that isn't strongly typed. Better to use:
const byte led = 13;
Then the compiler knows that it's a byte type and tells you if you do something stupid with it.