So I am working on a piece of Arduino code in which I have a byte array like this:
byte bArray[] = {0xC5, 0x41, 0x21, 0x12, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xAA, 0x37, 0x06, 0x00, 0x00, 0x00, 0x00, 0xD0, 0x07, 0x00, 0x00, 0xD0, 0x07, 0x00, 0x00, 0xF4, 0x01, 0x00, 0x00, 0xF4, 0x01, 0x00, 0x00, 0x00, 0x00};
I then have a long value such as:
long lVal = 523669250;
I need this value to be converted to hex: 0x1F368F02 and then stored in the byte array in positions bArray[14] to bArray[17] in little endian format, such that:
bArray[14] = 0x02, bArray[15] = 0x8F, bArray[16] = 36, bArray[17] = 0x52.
And this is what I am stuck at. Any suggestions as to how to do this would be greatly appreciated!
[/code]