Hi,
I had to turn some bytes into a long, so I made a function to bitshift the bytes into a long.
It looked like everything was fine until I got some confusing discrepancies in my values.
Some inputs gets the wrong output. I have now tried another function that works better, but I would still like to know whats wrong with my bit shoft function.
uint32_t byteToLong_1 (uint8_t byte3, uint8_t byte2, int8_t byte1, uint8_t byte0){
return (uint32_t)byte3<<24 | (uint32_t)byte2<<16 | (uint32_t)byte1<<8 | (uint32_t)byte0;
}
