Hello,
Currently I am reading in can bus data and I am attempting to work with the following information.
CAN ID: 0x372
0 0 0 0 0 0 3 AC
This data is being passed to " unsigned char buf[8]; " , So if was to run "SERIAL.print(buf[7], HEX);" I would get the value "AC" returned.
I needed to combine these two values and the only way I was able to combine them to be the value "3AC" and not add together as equation was to use the string function.
String byte6 =String(buf[6],HEX);
String byte7 =String(buf[7],HEX);
String afr = String(byte6+byte7);
But now that I have the value of "3AC" I am not sure use 3AC or convert it back to an integer I can read as the decimal value of 940.
I am sure there is a better way to do this and I probably should not be using a String at all, if anyone could give me some insight on where I am going wrong I would greatly appreciate your help.
Thank you