9 lines
193 B
Python
9 lines
193 B
Python
import RPi.GPIO as GPIO
|
|
|
|
class TempSensor:
|
|
def __init__(self, pin):
|
|
self.pin = pin
|
|
GPIO.setup(pin, GPIO.IN)
|
|
|
|
def read_data(self):
|
|
return GPIO.input(self.pin) |