code esteban
This commit is contained in:
25
composants/byPanda/etatsysteme.py
Normal file
25
composants/byPanda/etatsysteme.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import RPi.GPIO as GPIO
|
||||
|
||||
GPIO.setmode(GPIO.BOARD)
|
||||
GPIO.setwarnings(False)
|
||||
|
||||
|
||||
class EtatSysteme:
|
||||
def __init__(self):
|
||||
self.pinLedRouge = 35
|
||||
self.pinLedVerte = 37
|
||||
|
||||
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)
|
||||
Reference in New Issue
Block a user