Memory usage: #define vs. static const for uint8_t I'm writing an Arduino library to communicate with an I2C device, and I'm wondering what the best way is to declare all the register addresses so as to save memory.

Using #defines:

#define REGISTER_MOTOR_1_MODE 0x44
#define REGISTER_MOTOR_2_MODE 0x47


Or using static const:

static const uint8_t REGISTER_MOTOR_1_MODE = 0x44;
static const uint8_t REGISTER_MOTOR_2_MODE = 0x47;


(Obviously I have more than just two registers I need to declare, but I thought two would illustrate the point just fine)
You'll find no noticeable difference memory-wise between the two.

The only real difference is that the const method also imposes a type to the value, which can be useful for function overloading or mathematical operations.