Home/Support/Support Forum/Problem deciphering %v API Frame
New and improved user forum site coming soon
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Problem deciphering %v API Frame

0 votes
I have a digimesh network of Xbee Pro 900HP radios working an automated irrigation scheme. The coordinator is connected to an arduino mega and is in API mode and sends ATCommands to remote radios to turn valves on/off. All works fine. I would also like to send the %V command say once per day to keep track of battery voltage on the remotes.
That seems to work fine too - in that the ATcommandresponse comes in as an API packet and is deciphered by xbee.h library and can be viewed on the serial monitor to give "Command Value = two bytes of hex". These are the correct voltage in mV. Say B F7 which = 3063mV. Or they can be serial printed in DEC as 11 and 247 which is also correct (11*256 + 247 = 3063)
However I don't seem to be able use these two bytes as an int to use in calculations - when I try I get 10 for each byte.
Is there a way to process this data frame in my arduino code so that the two bytes relating to voltage are available as an integer?
asked Feb 27, 2017 in Other/Legacy by Craig Stubbs New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
The %V is in mV so if your value is 0B F7, that would be 3063mV.
answered Apr 11, 2017 by mvut Veteran of the Digi Community (15,515 points)