I'm using Occidentalis v0.2 and calling modprobe with a python script to read out temperatures from one DS18B20!
I'm new to python as well so bear with me, this is a small part of my code:
with open(path, "r") as f:
contentArray = []
for line in f:
contentArray.append (line)
f.close
s = contentArray[0]
if s.find('YES'):
return contentArray[0]
else:
return 88
Example: contentArray[0] can give results as:
68 01 4b 46 7f ff 0c 10 05 : crc=3e NO
or:
68 01 4b 46 7f ff 08 10 05 : crc=05 YES
If the above code is wrong, how do I do to find the YES
? Because this states
correct CRC. If I have a yes, I actually want to return contentArray[1]
(which
contains the correct temperature value).