Alter CAN Message Data, Array to Int
Hello,
This is a mixture of a C question and a CAN communication question, as I want to find the simplest solution for what I'm trying to do. I have an 8 byte CAN message that I successfully receive and store in an array (uint8_t RXData[8]). I am sending part of this data (RxData[0 to 3]) to a display on the STM32H7B3I-EVAL evaluation board.
I want to store the data in a single uint32_t variable (since RxData[0 to 3] represents a single piece of data. Specifically, a voltage). So storing it in pieces of an array makes it difficult to do arithmetic on it (scale the 0-65535 range of uint32_t to represent a voltage range of 0-60V).
What is the simplest way to do this?