diff --git a/Lycee/programmation_python/si/jumeau_numerique/portail_coulissant/porcou_cmd.py b/Lycee/programmation_python/si/jumeau_numerique/portail_coulissant/porcou_cmd.py new file mode 100644 index 0000000..e6f0307 --- /dev/null +++ b/Lycee/programmation_python/si/jumeau_numerique/portail_coulissant/porcou_cmd.py @@ -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()