Hi, I have a BQ76PL455 ti. I want to communicate this chip with Arduino. But I did not find a way to send a hex. When I try to send the following code, the Arduino compiler gives an overload error.
No, it will be in binary which is also what you will send. Hex is just a way to represent the value in a byte. If a byte has a hex value of 0x12 you equally have written this in decimal as 18 or in binary as 0B00010010. If you're an old geezer like me you could even write it in octal as 022. They all represent the same quantity.
Which variable should I save this response?
Depends how long the response will be. You could also re-use this same variable for other responses, in which case you would declare it to be as long as the longest response that you are expecting. If all responses are going to be less than, for example, 20 bytes then I'd declare a variable to have 24 bytes just to be sure.
uint8_t response[24];
Should I parse this coming message too?
You should always check whatever response you get to make sure that whatever message you've just sent was received correctly.
Rorschac:
I solved the problem, thank you. You're really very helpful.
But, there are questions to ask -- why the number 0x8901000A00DA83 is to be broken into byte oriented chunks in order to use this command:
Serial.write(msg, sizeof(msg));
The number can also be sent using this command: The number should not be sent in the following format as the the receiving instrument (Q76PL455 ti) demands natural binary numbers. See Post#6 of @el_supremo
Serial.print("8901000A00DA83");
Then, what are the merits and demerits of sending the number using either of the following two commands:
I have one doubt. after giving this program we will get a response? or we need to initialise anything?
I want to get a voltage reading along with temperature how to modify the program?
the command for voltage is 81 01 02 01 B95C
for temperature sensor am connecting to the 8 AUX pins. how should I program? please help me, sir
am using Arduino UNO board. while loop testing I am getting an error.
I want to connect with BQ76PL455A-Q1. Could you please help me with this programming part?