Ajout du script élève

This commit is contained in:
Philippe Roy 2023-02-08 11:36:33 +01:00
parent 8c38ac74f8
commit 9078b022d8
1 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,65 @@
from porcou_lib import * # Bibliothèque utilisateur du portail coulissant
###############################################################################
# porcou_cmd.py
# @title: Commandes du portail coulissant
###############################################################################
###############################################################################
# Instructions élémentaires pour le portail coulissant
#
# Actions (ordre = True ou False) :
# - Gyrophare : gyr(True | False)
# - Ouvrir le portail (moteur sens trigo) : mot_o(True | False)
# - Fermer le portail (moteur sens horaire) : mot_f(True | False)
# - Emetteur pour le capteur barrage IR : ir_emet(True | False)
#
# Capteurs (valeur retournée = True ou False) :
# - Capteur fin de course portail ouvert : fdc_o()
# - Capteur fin de course portail fermé : fdc_f()
# - Capteur barrage IR (absence d'obstacle) : ir_recep()
#
# Consignes du pupitre (valeur retournée = True ou False) :
# - Bouton poussoir coté rue : bp_ext()
# - Bouton poussoir coté cour : bp_int()
#
# Gestion du temps :
# - Temporisation en seconde : tempo(duree)
#
###############################################################################
# Brochage du portail coulissant
brochage={
'bp_ext' : [],'bp_int' : [],
'fdc_o' : [],'fdc_f' : [],
'mot_o' : [],'mot_f' : [],
'gyr' : [],
'ir_emet' : [],'ir_recep' : []}
###############################################################################
# Fonctions
###############################################################################
###############################################################################
# Commandes
###############################################################################
def commandes():
# Ecrire votre code ici ...
gyr(True) # Activer le gyrophare
while True:
pass
fin() # A garder
###############################################################################
# En: External call << DONT CHANGE THIS SECTION >>
# Fr: Appel externe << NE PAS MODIFIER CETTE SECTION >>
###############################################################################
if __name__=='start':
start(commandes)
if __name__=='stop':
stop()