Files

12 lines
201 B
Python
Raw Permalink Normal View History

2026-04-02 22:20:07 +02:00
import RPi.GPIO as GPIO
LDR_PIN = 20
GPIO.setmode(GPIO.BCM)
GPIO.setup(LDR_PIN, GPIO.IN)
def lire_etat():
if GPIO.input(LDR_PIN) == GPIO.HIGH:
return "Nuit"
return "Jour"