Pages: [1]   Go Down
Author Topic: define constant with two hex values, and naming arrays?  (Read 1016 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
Karma: 0
Posts: 151
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can I define a constant variable with two hex values?

#define PARAM_1 0x01 0x09
#define PARAM_2 0x09 0x05


And then

will that print 0x01 0x09 to the target ?

Then I want to name them for display on LCD - but for that I want an array:
names[PARAM_1] = 'My Disp Text';
names[PARAM_2] = 'My Next Text';
(I'd like to look at the array with the hex constant to find the name) - as names[0x01 0x09] - I know that's not going to work..) -

Any thoughts on the array?

Fort Lauderdale, FL
Offline Offline
Faraday Member
Karma: 71
Posts: 6144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

#define is just a simple text-replace macro.

This code:
#define something 0x01
void loop() {

Is equivilant to:
void loop() {


Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog:  || Electronics Tutorials for Beginners:  www.addohms.c

Pages: [1]   Go Up
Jump to: