Page 1 of 1

Serial inclinometer

Posted: Wed Apr 12, 2017 12:48 pm
by Celestial_Mech
I have one of these inclinometer packages plugged into with its provided USB/serial adapter:
https://www.amazon.co.uk/inclinometer-v ... ter+sensor
I have succeeded in printing the raw hex input to the terminal. But how do I get from that to extracting a variable (yaw angle in this case)? I guess I need to a way of selecting the starting value of the data packet and then picking out the item I want, but I can't find a worked example. I'm also expecting to need something similar to read the analogue in from a Gertbot, but that's the next problem!
Thanks
Robin

Re: Serial inclinometer

Posted: Wed Apr 12, 2017 1:21 pm
by scotty101
There is a datasheet for the device here https://www.scribd.com/document/2768417 ... Elecmaster

It has some C code examples that should help you. Each data packet starts with a 0x55, then another byte indicating the type of packet.

Re: Serial inclinometer

Posted: Wed Apr 12, 2017 1:33 pm
by Celestial_Mech
Yes I see that's a good start, so it appears I'm looking for 0x55 followed by 0x53, then the 6th and 7th variables afterwards. Do you know what the "High" and "Low" aspects to the data are? Is that like most and least significant bits?
Thanks
Robin

Re: Serial inclinometer

Posted: Wed Apr 12, 2017 4:18 pm
by scotty101
High byte and Low byte.

High Byte is the most significant byte in the 16 bit word, Low Byte is the least significant byte.