I am a bit confused. So I want to send messages between two arduinos over RS485, but these are not fixed length, naturally, I have to send the length of the message or add a delimiter to understand that my message has ended.
Suppose, now I create a placeholder for the message, and both ends communicating are receiving the placeholder, rather than the message itself. This placeholder is x bytes long always, and each arduino can look it up from its memory what message corresponds to the placeholder.
Lets say I create a message.h file with contents like this
#define A "First Message"
#define B "Second Message"
When the two devices are communicating, they send each other A or B, and the Arduino looks it up in its .h file what A and B mean.
My question is when the Arduino recieves the A, it recieves a character 'A', but how can I use this to fetch the value assigned to variable A in memory?
#define
A
you arduinos will see the stuff in the" "
and not just A – RSM Jul 19 '15 at 12:24