finally the end of the road
This commit is contained in:
12
composants/byPanda/LDR.py
Normal file
12
composants/byPanda/LDR.py
Normal file
@@ -0,0 +1,12 @@
|
||||
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"
|
||||
Reference in New Issue
Block a user