I have a sketch that runs OK with a fixed uint32_t value in my Arduino Due:
Example:
#define VALUE_1 0x12345678
What I need is, instead of use VALUE_1 as a fixed value, to make it variable through the terminal.
In other words, I need to type for example 0x87654321 in the Arduino IDE terminal and assign that new entry to VALUE_1. How could I do that? Thank you for any help.
Decide on a terminating character. Read data from the Serial buffer into an array until the terminating character, appending a null termintor along the way. Once you have the full string, use sscanf() to turn the hex string into binary.