Hi there! Im new to understanding bytes and stuff. I'm working with a CAN instrument panel. Control of the speedometer is a tiny bit tricky as it uses 2 bytes in an 8 byte array. Bytes 4 and 5. I think I know how I want to do the majority of my work? But I need help with figuring out how to code into 2 separate bytes.
map(MPH, 0, 318, 0, 65405) I think? 65405 because this is the value that the speedometer "maxes" out at when bytes 4,5 are sent (255, 125) And I think the math for this is byte4*256+byte5?
The map function will return any decimal value anywhere between 0 and 65405 if I understand it correctly, and I dont know how to break that properly into Byte4, byte5 every time. Like if it returns 0, or 10, or 57 ect.