I am using DS18B20 Temperature sensor on Raspberry Pi. For that I installed w1thermsensor library on my Raspberry Pi. My code is given below.

import time
from w1thermsensor import W1ThermSensor
sensor = W1ThermSensor()

while True:
     temperature = sensor.get_temperature()
     print("Temperature %s celcious"%temperature)

When I run this code from python editor using f5 it works fine. But when I run the code from terminal it shows me:

w1thermsensor is not detected

Why does it happen? How to solve this problem?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.