Post
by Basicmicro Support » Fri Nov 08, 2019 10:34 am
I got a copy of the pre-release for the next update of the python library. These are the defined functions for reading the L and R values.
def GetM1LR(self,address):
date = self._read_n(address,self.Cmd.GETM1LR,2)
if data[0]:
return (1,data[1]/0x1000000,data[2]/0x1000000)
return (0,0,0)
def GetM2LR(self,address):
data = self._read_n(address,self.Cmd.GETM2LR,2)
if data[0]:
return (1,data[1]/0x1000000,data[2]/0x1000000)
return (0,0,0)
The cmd defines are:
SETM1LR = 128 #MCP only
SETM2LR = 129 #MCP only
GETM1LR = 130 #MCP only
GETM2LR = 131 #MCP only
I don't see much difference between yours and ours except for the divide we do to convert the fixed point value to a double. Note we also do a check on data[0] to make sure the command executed properly and the CRC16 matched.