Hi,
I am trying to combine four elements of unsigned char array into one unsigned long variable,
this is my code,
rx_buf[4] is unsigned char array
temp1 is unsigned int variable
message_ID is unsigned long variable
temp1 = (unsigned int)((rx_buf[j-3])|(rx_buf[j-4]<<8)); //get the upper two bytes
message_ID = (unsigned long)((temp1<<16) | ((rx_buf[j-2]<<8)|(rx_buf[j-1])));
But with this code not able to combine the same please suggest or any code if you have.
Thanks & Regards,
Sachin