getting separate values for acc. axes


I'm running the example.

there is a print to the console of data variable.

Is this data variable a structure? Is it a string?

How do I get separate values for all the 3 axes?

something like:

x = data.x.
y = data.y
x = data.z

I attaching part of the code as a reference.

class State:
def __init__(self, device):
    self.device = device
    self.samples = 0
    self.callback = FnVoid_VoidP_DataP(self.data_handler)

def data_handler(self, ctx, data):
    print("%s -> %s" % (self.device.address, parse_value(data)))
    self.samples+= 1



  • Please read the parse_value code and also see our tutorial and the C tutorial about data types

Sign In or Register to comment.