Hi Kevin,
Code: Select all
import onewire
import ds18x20
try:
roms = ds.scan()
except OneWireError as error:
try:
with open('errors.txt', 'a') as outfile:
outfile.write(str(error) + '\n')
except OSError:
pass
and
Code: Select all
try:
roms = ds.scan()
except onewire.OneWireError as error:
try:
with open('errors.txt', 'a') as outfile:
outfile.write(str(error) + '\n')
except OSError:
pass
Both seems to work in the sense that I don't get any
errors, but are they both gathering the same information?
Also, I have seen this example:
Code: Select all
for rom in roms:
try:
print (ds.read_temp (rom), end = '|')
except CRCError:
print("CRC error reading the temperature, unit", rom)
I don't see CRCError in onewire.py so I guess CRCError is defined
somewhere else, but where?
In ds18x20.py I see:
but still no CRCError
Thanks,
Dave