Because the LED Driver takes values 0 - 1023 for each channel.
My computer application will output FFFFFF for white, therefore I need to convert it.
colour = FFFFFF
r = 255, g = 255, b = 255.
r = 1023, g = 1023, b = 1023.
and for any other hex value.
Is there a function that converts an ASCII hex value to numeric?
Your computer application should output values that match the LED driver.
The main reason is that I can send all the values in one packet if they are 6 digit hex values, and also I don't really need that much colour resolution.
The main reason is that I can send all the values in one packet if they are 6 digit hex values
Sending 3 bytes worth of data in 6 characters is not more efficient than sending 3 ints worth of data in 6 bytes.
The FFFFFF pattern may look like it means something to you. Sending 1023 as 2 bytes, three times, means just as much to the Arduino, and requires no strtoul() conversion on the receiving end. Just some bit shifting, which is way faster.
Sending 3 bytes is even faster and even simpler to decode, just shift the 3 bytes by 2 to get your 10 bit range. You don't have more granularity anyway.
Sending 3 bytes worth of data in 6 characters is not more efficient than sending 3 ints worth of data in 6 bytes.
ahh yes, because I was also dealing with text elements I got it stuck in my head that every character was a byte.
Sending 3 bytes is even faster and even simpler to decode, just shift the 3 bytes by 2 to get your 10 bit range. You don't have more granularity anyway.