First, I don't understand how to convert the six sensor readings (MSB & LSB for X, Y, & Z axes). After the "recieve byte" read macro is sent, the instructions say to "Convert three 16-bit 2’s compliment hex values to decimal values and assign to X, Z, Y, respectively."
This confuses me. Do I make the return output a variable? If so, how do I assign a variable to "X,Z,Y". What exactly is "X,Z,Y" I am confident the answer involves using the registers, but the instructions don't explain this (at least not at my level), and I am not sure what to do. I do know that each axis letter has two registers assigned to it, if that helps.
Also, I have hit a wall on converting the hex values to decimal values. I have a working hex-to-decimal macro, but it only takes strings, and the reading only produces bytes. My first solution was to try the "ToString$()" function, but it won't work. Any ideas on how to convert to decimals here?
To illustrate my sitution, I've added the relavant instrution from the manuel and part of my flowcode to compare it. Again, deep thanks for any assistance.
**PDF: http://dlnmh9ip6v2uc.cloudfront.net/dat ... 3L-FDS.pdf
Below is an example of a (power-on) initialization process for “single-measurement mode”:
1. Write CRA (00) – send 0x3C 0x00 0x70 (8-average, 15 Hz default or any other rate, normal measurement)
2. Write CRB (01) – send 0x3C 0x01 0xA0 (Gain=5, or any other desired gain)
3. For each measurement query:
Write Mode (02) – send 0x3C 0x02 0x01 (Single-measurement mode)
Wait 6 ms or monitor status register or DRDY hardware interrupt pin
Send 0x3D 0x06 (Read all 6 bytes. If gain is changed then this data set is using previous gain)
Convert three 16-bit 2’s compliment hex values to decimal values and assign to X, Z, Y, respectively.