Sep-21-2020, 02:26 AM
Hey everyone,
I am working on a python script that uses a thermometer. I want to put a line of code in that test to make sure the thermometer is hooked up, so I using "try except".
I found a library that seems to do a good job, but the error code that comes back when the thermometer is missing is:
I tried:
Thanks
I am working on a python script that uses a thermometer. I want to put a line of code in that test to make sure the thermometer is hooked up, so I using "try except".
I found a library that seems to do a good job, but the error code that comes back when the thermometer is missing is:
w1thermsensor.errors.NoSensorFoundError: Could not find sensor of type DS18B20 with id 0300a27989942 Please check cabling and check your /boot/config.txt for dtoverlay=w1-gpiois there a way I can tell Try ... Except to look for that error in particular?
I tried:
try: verify code: except w1thermsensor.errors.NoSensorFoundError return resultsAny ideas?
Thanks