Go Down

Topic: define constant with two hex values, and naming arrays? (Read 2618 times) previous topic - next topic


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?

James C4S

#define is just a simple text-replace macro.

This code:
Code: [Select]

#define something 0x01
void loop() {

Is equivilant to:
Code: [Select]

void loop() {

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

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131