def WriteReg(reg, data): print "Write Reg [", reg, "] =", data, if Click.WriteI2C(WR_PTR, reg >> 7, reg & 0x7F): if Click.WriteI2C(WR_IND, data, 0): print "OK" return #else print "Fail"
def ReadReg(reg): print "Read Reg [", reg, "] =", if Click.WriteI2C(WR_PTR, reg >> 7, reg & 0x7f): r = Click.ReadI2C(RD_IND) if r[0] == 0x21: print r[1] return #else print "Fail"