hippy
Ex-Staff (retired)
Forget about that issue. Just check that it works as expected for small turns to the left and right, small tilts upwards and downwards. And do it with simple code -My results are the same, does not matter how I try to read them, I cannot get over this problem where I get the same results for different angles, so something is not reporting correctly.
Code:
Symbol ReserveW0 = w0 ; b1:b0
Symbol x = w1 ; b3:b2
Symbol x.lsb = b2
Symbol x.msb = b3
Symbol y = w2 ; b5:b4
Symbol y.lsb = b4
Symbol y.msb = b5
Symbol z = w3 ; b7:b6
Symbol z.lsb = b6
Symbol z.msb = b7
hi2csetup i2cmaster, $A6, i2cslow, i2cbyte
HI2cOut $2D, (8)
Do
HI2cIn $3B, ( x.msb,x.lsb , y.msb,y.lsb , z.msb,z.lsb )
SerTxd( CR, LF, "X=" ) : w0 = x : Gosub Show
SerTxd( TAB, "Y=" ) : w0 = y : Gosub Show
SerTxd( TAB, "Z=" ) : w0 = z : Gosub Show
Loop
Show:
If w0 >= $8000 Then
SerTxd( "-" )
w0 = -w0
End If
SerTxd( #w0 )
Return
Last edited: