2026-03-27 13:29:22 +01:00
|
|
|
import RPi.GPIO as GPIO
|
|
|
|
|
|
2026-03-31 20:09:26 +02:00
|
|
|
GPIO.setmode(GPIO.BCM)
|
2026-03-27 13:29:22 +01:00
|
|
|
GPIO.setwarnings(False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class EtatSysteme:
|
|
|
|
|
def __init__(self):
|
2026-03-31 20:09:26 +02:00
|
|
|
self.pinLedRouge = 19
|
|
|
|
|
self.pinLedVerte = 26
|
2026-03-27 13:29:22 +01:00
|
|
|
|
|
|
|
|
GPIO.setup(self.pinLedRouge, GPIO.OUT, initial=GPIO.LOW)
|
|
|
|
|
GPIO.setup(self.pinLedVerte, GPIO.OUT, initial=GPIO.LOW)
|
|
|
|
|
|
|
|
|
|
def signalerOk(self):
|
|
|
|
|
GPIO.output(self.pinLedVerte, GPIO.HIGH)
|
|
|
|
|
GPIO.output(self.pinLedRouge, GPIO.LOW)
|
|
|
|
|
|
|
|
|
|
def signalerProbleme(self):
|
|
|
|
|
GPIO.output(self.pinLedVerte, GPIO.LOW)
|
|
|
|
|
GPIO.output(self.pinLedRouge, GPIO.HIGH)
|
|
|
|
|
|
|
|
|
|
def cleanup(self):
|
|
|
|
|
GPIO.output(self.pinLedRouge, GPIO.LOW)
|
|
|
|
|
GPIO.output(self.pinLedVerte, GPIO.LOW)
|