def readConfig(self):
self.config=owcom(self.owid,[0x85],26)
+ print self.config
if self.config[0]==0xFF:
print("No Deviceconfig. Not a Device form tm3d.de. Set Default");
self.setdefaultConfig()
else:
if self.config[25]==0xFF:
- if not(crc8(self.config[0:24])):
+ if crc8(self.config[0:24]):
print("CRC Error reading Deviceconfig. Set Default")
self.setdefaultConfig()
else:
owcom(self.owid,[0xB4],0)
time.sleep(0.01)
sp=self.readScratchpad(0,True)
+ if sp==[]:
+ return
temp=ow_fconvert(sp[1],sp[2]);
VDD=ow_fconvert(sp[3],sp[4]);
self.setConfigByte(0x00)
owcom(self.owid,[0xB4],0)
time.sleep(0.01)
sp=self.readScratchpad(0,True);
+ if sp==[]:
+ return
I=ow_fconvert(sp[5],sp[6]);
VAD=ow_fconvert(sp[3],sp[4]);
self.raw[0]=temp;