def __init__(self, port, addr=0x69): self.bus = i2c.i2c(port, addr) self.setPowerManagement(0x00) self.setSampleRateDivider(0x07) self.setDLPFAndFullScale(self.FullScale_2000_sec, self.DLPF_188_1) self.setInterrupt(self.IC_LatchUntilIntCleared, self.IC_IntOnDeviceReady, self.IC_IntOnDataReady)
def __init__(self, port, addr=0x53): self.bus = i2c.i2c(port, addr) self.wakeUp(); # Set defaults self.setScale(); self.setTapThreshold() self.setTapDuration() self.setTapLatency() self.setTapWindow() self.setActivityThreshold() self.setInactivityThreshold() self.setInactivityTime() self.setFreeFallThreshold() self.setFreeFallTime()