Hi, I am trying to read out the accelerometer and gyroscope from the ti sensortag cc2650. I took the example given in cb lib to try it out.
I gave a look at the cc2650 wiki (wiki and there is a configuration characteristic which should be set up to enable/disable the sensor.
In my case, I set this configuration as follows :
Bit 0 to 5 = 1
Bit 6 to 7 = 0
Bit 8 = 0
Bit 9 = 1 ---> so I wrote 0x011F in the configuration using the callback function did_discover_characteristics() but I receiving this output :
(-393, 0, 0, 0, 0, 0, 268, -341, 582) --> rawData converted from binary used the struct.unpack function. But it doesn't match. And I have this problem with every configuration.
Here is the part of the code where Iam reading out the data and convert it. What Iam doing wrong?
def did_discover_characteristics(self, s, error):
if 'AA80' in s.uuid:
print('mpu9250 service')
for c in s.characteristics:
if 'AA82' in c.uuid:
self.peripheral.write:characteristics_value(c, chr(0x011F), True)
elif 'AA81' in c.uuid:
self.peripheral.set_notify_value(c, True)
def did_update_value(self,c, error):
rawData=()
#use unpack to convert binary..> little endian and 9x 2Bytes
rawData = struct.unpack('<hhhhhhhhh', c.value)
print(rawData)
This is the essential part of my code. So how you can see it should work but the output is not the expected one. Do you know where maybe what can be the problem?