mirror of
https://forge.apps.education.fr/blender-edutech/blender-edutech-ressources-pedagogiques.git
synced 2024-01-27 08:26:31 +01:00
Ajout des corrections
This commit is contained in:
parent
61ad8de84e
commit
8756f8447d
@ -61,7 +61,7 @@ def commandes():
|
|||||||
voy_0(True)
|
voy_0(True)
|
||||||
while pc_0() ==False:
|
while pc_0() ==False:
|
||||||
mot_m(False)
|
mot_m(False)
|
||||||
mot_d(True)g
|
mot_d(True)
|
||||||
mot_d(False)
|
mot_d(False)
|
||||||
tempo(2) # Temporisation 2s
|
tempo(2) # Temporisation 2s
|
||||||
voy_0(False)
|
voy_0(False)
|
||||||
|
@ -57,6 +57,7 @@ def commandes():
|
|||||||
print ("Mise en place : Fermeture")
|
print ("Mise en place : Fermeture")
|
||||||
while fdc_f() ==False :
|
while fdc_f() ==False :
|
||||||
gyr(True)
|
gyr(True)
|
||||||
|
mot_o(False)
|
||||||
mot_f(True)
|
mot_f(True)
|
||||||
mot_f(False)
|
mot_f(False)
|
||||||
gyr(False)
|
gyr(False)
|
||||||
@ -70,6 +71,7 @@ def commandes():
|
|||||||
print ("Ouverture")
|
print ("Ouverture")
|
||||||
while fdc_o() ==False:
|
while fdc_o() ==False:
|
||||||
gyr(True)
|
gyr(True)
|
||||||
|
mot_f(False)
|
||||||
mot_o(True)
|
mot_o(True)
|
||||||
gyr(False)
|
gyr(False)
|
||||||
mot_o(False)
|
mot_o(False)
|
||||||
@ -81,6 +83,7 @@ def commandes():
|
|||||||
print ("Fermeture")
|
print ("Fermeture")
|
||||||
while fdc_f() ==False:
|
while fdc_f() ==False:
|
||||||
gyr(True)
|
gyr(True)
|
||||||
|
mot_o(False)
|
||||||
mot_f(True)
|
mot_f(True)
|
||||||
gyr(False)
|
gyr(False)
|
||||||
mot_f(False)
|
mot_f(False)
|
||||||
|
@ -0,0 +1,117 @@
|
|||||||
|
from volrou_lib import * # Bibliothèque volet roulant
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# volrou_cmd.py
|
||||||
|
# @title: Commandes du volet roulant
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Instructions élémentaires pour le volet roulant
|
||||||
|
#
|
||||||
|
# Actions (ordre = True ou False) :
|
||||||
|
# - Monter le volet (moteur sens trigo) : mot_m(True | False)
|
||||||
|
# - Descendre le volet (moteur sens horaire) : mot_d(True | False)
|
||||||
|
#
|
||||||
|
# Capteurs (valeur retournée = True ou False) :
|
||||||
|
# - Capteur fin de course volet en haut : fdc_h()
|
||||||
|
# - Capteur fin de course volet en bas : fdc_b()
|
||||||
|
# - Capteur de luminosité (LDR) : lum()
|
||||||
|
#
|
||||||
|
# Consignes du pupitre (valeur retournée = True ou False) :
|
||||||
|
# - Bouton poussoir monter volet : bp_m()
|
||||||
|
# - Bouton poussoir arrêt volet : bp_a()
|
||||||
|
# - Bouton poussoir descendre volet : bp_d()
|
||||||
|
# - Bouton poussoir mode automatique : bp_auto()
|
||||||
|
#
|
||||||
|
# Retour d'information du pupitre (allumer = True ou False) :
|
||||||
|
# - Voyant témoin mode automatique : voy_auto(True | False)
|
||||||
|
#
|
||||||
|
# Gestion du temps :
|
||||||
|
# - Temporisation en seconde : tempo(duree)
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
# Brochage du volet roulant
|
||||||
|
brochage={}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Fonctions
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Commandes
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
def commandes():
|
||||||
|
|
||||||
|
# Mise en place : Monter le store
|
||||||
|
print ("Volet roulant avec le mode automatique")
|
||||||
|
print ("Mise en place : Monter le store")
|
||||||
|
while fdc_h() ==False :
|
||||||
|
mot_d(False)
|
||||||
|
mot_m(True)
|
||||||
|
mot_m(False)
|
||||||
|
|
||||||
|
# Fonctionnement normal
|
||||||
|
print ("Attente")
|
||||||
|
auto=False # Mémorisation du mode automatique
|
||||||
|
while True :
|
||||||
|
|
||||||
|
# Mode automatique
|
||||||
|
if bp_auto():
|
||||||
|
print ("Passage en mode automatique")
|
||||||
|
auto=True
|
||||||
|
voy_auto(True)
|
||||||
|
|
||||||
|
# Monter le store manuellement
|
||||||
|
if bp_m():
|
||||||
|
print ("Commande manuelle : monter le store ...")
|
||||||
|
mot_d(False)
|
||||||
|
mot_m(True)
|
||||||
|
auto=False
|
||||||
|
voy_auto(False)
|
||||||
|
|
||||||
|
# Descendre le store
|
||||||
|
if bp_d():
|
||||||
|
print ("Commande manuelle : descendre le store ...")
|
||||||
|
mot_m(False)
|
||||||
|
mot_d(True)
|
||||||
|
auto=False
|
||||||
|
voy_auto(False)
|
||||||
|
|
||||||
|
# Arrêt du moteur
|
||||||
|
if fdc_h() :
|
||||||
|
mot_m(False)
|
||||||
|
if fdc_b() :
|
||||||
|
mot_d(False)
|
||||||
|
|
||||||
|
# Arrêt
|
||||||
|
if bp_a():
|
||||||
|
print ("Commande manuelle : arrêter le store")
|
||||||
|
mot_m(False)
|
||||||
|
mot_d(False)
|
||||||
|
auto=False
|
||||||
|
voy_auto(False)
|
||||||
|
|
||||||
|
# Monter le store automatiquement
|
||||||
|
if auto and fdc_h()==False and lum() == False:
|
||||||
|
mot_d(False)
|
||||||
|
mot_m(True)
|
||||||
|
|
||||||
|
# Descendre le store automatiquement
|
||||||
|
if auto and fdc_b()==False and lum() == True:
|
||||||
|
mot_m(False)
|
||||||
|
mot_d(True)
|
||||||
|
|
||||||
|
fin() # A garder
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# En: External call << DONT CHANGE THIS SECTION >>
|
||||||
|
# Fr: Appel externe << NE PAS MODIFIER CETTE SECTION >>
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
if __name__=='start':
|
||||||
|
thread_cmd_start(commandes)
|
||||||
|
if __name__=='stop':
|
||||||
|
thread_cmd_stop()
|
@ -0,0 +1,117 @@
|
|||||||
|
from volrou_lib import * # Bibliothèque volet roulant
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# volrou_cmd.py
|
||||||
|
# @title: Commandes du volet roulant
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Instructions élémentaires pour le volet roulant
|
||||||
|
#
|
||||||
|
# Actions (ordre = True ou False) :
|
||||||
|
# - Monter le volet (moteur sens trigo) : mot_m(True | False)
|
||||||
|
# - Descendre le volet (moteur sens horaire) : mot_d(True | False)
|
||||||
|
#
|
||||||
|
# Capteurs (valeur retournée = True ou False) :
|
||||||
|
# - Capteur fin de course volet en haut : fdc_h()
|
||||||
|
# - Capteur fin de course volet en bas : fdc_b()
|
||||||
|
# - Capteur de luminosité (LDR) : lum()
|
||||||
|
#
|
||||||
|
# Consignes du pupitre (valeur retournée = True ou False) :
|
||||||
|
# - Bouton poussoir monter volet : bp_m()
|
||||||
|
# - Bouton poussoir arrêt volet : bp_a()
|
||||||
|
# - Bouton poussoir descendre volet : bp_d()
|
||||||
|
# - Bouton poussoir mode automatique : bp_auto()
|
||||||
|
#
|
||||||
|
# Retour d'information du pupitre (allumer = True ou False) :
|
||||||
|
# - Voyant témoin mode automatique : voy_auto(True | False)
|
||||||
|
#
|
||||||
|
# Gestion du temps :
|
||||||
|
# - Temporisation en seconde : tempo(duree)
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
# Brochage du volet roulant
|
||||||
|
brochage={}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Fonctions
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Commandes
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
def commandes():
|
||||||
|
|
||||||
|
# Mise en place : Monter le store
|
||||||
|
print ("Volet roulant avec le mode automatique")
|
||||||
|
print ("Mise en place : Monter le store")
|
||||||
|
while fdc_h() ==False :
|
||||||
|
mot_d(False)
|
||||||
|
mot_m(True)
|
||||||
|
mot_m(False)
|
||||||
|
|
||||||
|
# Fonctionnement normal
|
||||||
|
print ("Attente")
|
||||||
|
auto=False # Mémorisation du mode automatique
|
||||||
|
while True :
|
||||||
|
|
||||||
|
# Mode automatique
|
||||||
|
if bp_auto():
|
||||||
|
print ("Passage en mode automatique")
|
||||||
|
auto=True
|
||||||
|
voy_auto(True)
|
||||||
|
|
||||||
|
# Monter le store manuellement
|
||||||
|
if bp_m():
|
||||||
|
print ("Commande manuelle : monter le store ...")
|
||||||
|
mot_d(False)
|
||||||
|
mot_m(True)
|
||||||
|
auto=False
|
||||||
|
voy_auto(False)
|
||||||
|
|
||||||
|
# Descendre le store
|
||||||
|
if bp_d():
|
||||||
|
print ("Commande manuelle : descendre le store ...")
|
||||||
|
mot_m(False)
|
||||||
|
mot_d(True)
|
||||||
|
auto=False
|
||||||
|
voy_auto(False)
|
||||||
|
|
||||||
|
# Arrêt du moteur
|
||||||
|
if fdc_h() :
|
||||||
|
mot_m(False)
|
||||||
|
if fdc_b() :
|
||||||
|
mot_d(False)
|
||||||
|
|
||||||
|
# Arrêt
|
||||||
|
if bp_a():
|
||||||
|
print ("Commande manuelle : arrêter le store")
|
||||||
|
mot_m(False)
|
||||||
|
mot_d(False)
|
||||||
|
auto=False
|
||||||
|
voy_auto(False)
|
||||||
|
|
||||||
|
# Monter le store automatiquement
|
||||||
|
if auto and fdc_h()==False and lum() == False:
|
||||||
|
mot_d(False)
|
||||||
|
mot_m(True)
|
||||||
|
|
||||||
|
# Descendre le store automatiquement
|
||||||
|
if auto and fdc_b()==False and lum() == True:
|
||||||
|
mot_m(False)
|
||||||
|
mot_d(True)
|
||||||
|
|
||||||
|
fin() # A garder
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# En: External call << DONT CHANGE THIS SECTION >>
|
||||||
|
# Fr: Appel externe << NE PAS MODIFIER CETTE SECTION >>
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
if __name__=='start':
|
||||||
|
thread_cmd_start(commandes)
|
||||||
|
if __name__=='stop':
|
||||||
|
thread_cmd_stop()
|
@ -0,0 +1,93 @@
|
|||||||
|
from volrou_lib import * # Bibliothèque volet roulant
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# volrou_cmd.py
|
||||||
|
# @title: Commandes du volet roulant
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Instructions élémentaires pour le volet roulant
|
||||||
|
#
|
||||||
|
# Actions (ordre = True ou False) :
|
||||||
|
# - Monter le volet (moteur sens trigo) : mot_m(True | False)
|
||||||
|
# - Descendre le volet (moteur sens horaire) : mot_d(True | False)
|
||||||
|
#
|
||||||
|
# Capteurs (valeur retournée = True ou False) :
|
||||||
|
# - Capteur fin de course volet en haut : fdc_h()
|
||||||
|
# - Capteur fin de course volet en bas : fdc_b()
|
||||||
|
# - Capteur de luminosité (LDR) : lum()
|
||||||
|
#
|
||||||
|
# Consignes du pupitre (valeur retournée = True ou False) :
|
||||||
|
# - Bouton poussoir monter volet : bp_m()
|
||||||
|
# - Bouton poussoir arrêt volet : bp_a()
|
||||||
|
# - Bouton poussoir descendre volet : bp_d()
|
||||||
|
# - Bouton poussoir mode automatique : bp_auto()
|
||||||
|
#
|
||||||
|
# Retour d'information du pupitre (allumer = True ou False) :
|
||||||
|
# - Voyant témoin mode automatique : voy_auto(True | False)
|
||||||
|
#
|
||||||
|
# Gestion du temps :
|
||||||
|
# - Temporisation en seconde : tempo(duree)
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
# Brochage du volet roulant
|
||||||
|
brochage={}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Fonctions
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Commandes
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
def commandes():
|
||||||
|
|
||||||
|
# Mise en place : Monter le store
|
||||||
|
print ("Volet roulant uniquement en mode manuel (sans le mode automatique)")
|
||||||
|
print ("Mise en place : Monter le store")
|
||||||
|
while fdc_h() ==False :
|
||||||
|
mot_d(False)
|
||||||
|
mot_m(True)
|
||||||
|
mot_m(False)
|
||||||
|
|
||||||
|
# Fonctionnement normal
|
||||||
|
print ("Attente")
|
||||||
|
while True :
|
||||||
|
|
||||||
|
# Monter le store
|
||||||
|
if bp_m():
|
||||||
|
print ("Monter le store ...")
|
||||||
|
mot_d(False)
|
||||||
|
mot_m(True)
|
||||||
|
|
||||||
|
# Descendre le store
|
||||||
|
if bp_d():
|
||||||
|
print ("Descendre le store ...")
|
||||||
|
mot_m(False)
|
||||||
|
mot_d(True)
|
||||||
|
|
||||||
|
# Arrêt du moteur
|
||||||
|
if fdc_h() :
|
||||||
|
mot_m(False)
|
||||||
|
if fdc_b() :
|
||||||
|
mot_d(False)
|
||||||
|
|
||||||
|
# Arrêt
|
||||||
|
if bp_a():
|
||||||
|
print ("Arrêter le store")
|
||||||
|
mot_m(False)
|
||||||
|
mot_d(False)
|
||||||
|
|
||||||
|
fin() # A garder
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# En: External call << DONT CHANGE THIS SECTION >>
|
||||||
|
# Fr: Appel externe << NE PAS MODIFIER CETTE SECTION >>
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
if __name__=='start':
|
||||||
|
thread_cmd_start(commandes)
|
||||||
|
if __name__=='stop':
|
||||||
|
thread_cmd_stop()
|
@ -0,0 +1,94 @@
|
|||||||
|
from volrou_lib import * # Bibliothèque volet roulant
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# volrou_cmd.py
|
||||||
|
# @title: Commandes du volet roulant
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Instructions élémentaires pour le volet roulant
|
||||||
|
#
|
||||||
|
# Actions (ordre = True ou False) :
|
||||||
|
# - Monter le volet (moteur sens trigo) : mot_m(True | False)
|
||||||
|
# - Descendre le volet (moteur sens horaire) : mot_d(True | False)
|
||||||
|
#
|
||||||
|
# Capteurs (valeur retournée = True ou False) :
|
||||||
|
# - Capteur fin de course volet en haut : fdc_h()
|
||||||
|
# - Capteur fin de course volet en bas : fdc_b()
|
||||||
|
# - Capteur de luminosité (LDR) : lum()
|
||||||
|
#
|
||||||
|
# Consignes du pupitre (valeur retournée = True ou False) :
|
||||||
|
# - Bouton poussoir monter volet : bp_m()
|
||||||
|
# - Bouton poussoir arrêt volet : bp_a()
|
||||||
|
# - Bouton poussoir descendre volet : bp_d()
|
||||||
|
# - Bouton poussoir mode automatique : bp_auto()
|
||||||
|
#
|
||||||
|
# Retour d'information du pupitre (allumer = True ou False) :
|
||||||
|
# - Voyant témoin mode automatique : voy_auto(True | False)
|
||||||
|
#
|
||||||
|
# Gestion du temps :
|
||||||
|
# - Temporisation en seconde : tempo(duree)
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
# Brochage du volet roulant
|
||||||
|
brochage={}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Fonctions
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Commandes
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
def commandes():
|
||||||
|
|
||||||
|
# Mise en place : Fermeture
|
||||||
|
print ("Volet roulant sans mode automatique")
|
||||||
|
print ("Mise en place : Ouverture")
|
||||||
|
while fdc_h() ==False :
|
||||||
|
mot_d(False)
|
||||||
|
mot_m(True)
|
||||||
|
mot_m(False)
|
||||||
|
|
||||||
|
# Fonctionnement normal
|
||||||
|
print ("Attente")
|
||||||
|
while True :
|
||||||
|
|
||||||
|
# if bp_auto():
|
||||||
|
# voy_auto(True)
|
||||||
|
|
||||||
|
# Monter le store
|
||||||
|
if bp_m():
|
||||||
|
mot_d(False)
|
||||||
|
mot_m(True)
|
||||||
|
if fdc_h() :
|
||||||
|
mot_m(False)
|
||||||
|
|
||||||
|
# Descendre le store
|
||||||
|
if bp_d():
|
||||||
|
mot_m(False)
|
||||||
|
mot_d(True)
|
||||||
|
if fdc_b() :
|
||||||
|
mot_d(False)
|
||||||
|
|
||||||
|
# Arrêt
|
||||||
|
if bp_a():
|
||||||
|
mot_m(False)
|
||||||
|
mot_d(False)
|
||||||
|
# voy_auto(False)
|
||||||
|
|
||||||
|
|
||||||
|
fin() # A garder
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# En: External call << DONT CHANGE THIS SECTION >>
|
||||||
|
# Fr: Appel externe << NE PAS MODIFIER CETTE SECTION >>
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
if __name__=='start':
|
||||||
|
thread_cmd_start(commandes)
|
||||||
|
if __name__=='stop':
|
||||||
|
thread_cmd_stop()
|
@ -0,0 +1,94 @@
|
|||||||
|
from volrou_lib import * # Bibliothèque volet roulant
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# volrou_cmd.py
|
||||||
|
# @title: Commandes du volet roulant
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Instructions élémentaires pour le volet roulant
|
||||||
|
#
|
||||||
|
# Actions (ordre = True ou False) :
|
||||||
|
# - Monter le volet (moteur sens trigo) : mot_m(True | False)
|
||||||
|
# - Descendre le volet (moteur sens horaire) : mot_d(True | False)
|
||||||
|
#
|
||||||
|
# Capteurs (valeur retournée = True ou False) :
|
||||||
|
# - Capteur fin de course volet en haut : fdc_h()
|
||||||
|
# - Capteur fin de course volet en bas : fdc_b()
|
||||||
|
# - Capteur de luminosité (LDR) : lum()
|
||||||
|
#
|
||||||
|
# Consignes du pupitre (valeur retournée = True ou False) :
|
||||||
|
# - Bouton poussoir monter volet : bp_m()
|
||||||
|
# - Bouton poussoir arrêt volet : bp_a()
|
||||||
|
# - Bouton poussoir descendre volet : bp_d()
|
||||||
|
# - Bouton poussoir mode automatique : bp_auto()
|
||||||
|
#
|
||||||
|
# Retour d'information du pupitre (allumer = True ou False) :
|
||||||
|
# - Voyant témoin mode automatique : voy_auto(True | False)
|
||||||
|
#
|
||||||
|
# Gestion du temps :
|
||||||
|
# - Temporisation en seconde : tempo(duree)
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
# Brochage du volet roulant
|
||||||
|
brochage={}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Fonctions
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Commandes
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
def commandes():
|
||||||
|
|
||||||
|
# Mise en place : Fermeture
|
||||||
|
print ("Volet roulant uniquement en mode manuel (sans mode automatique)")
|
||||||
|
print ("Mise en place : Ouverture")
|
||||||
|
while fdc_h() ==False :
|
||||||
|
mot_d(False)
|
||||||
|
mot_m(True)
|
||||||
|
mot_m(False)
|
||||||
|
|
||||||
|
# Fonctionnement normal
|
||||||
|
print ("Attente")
|
||||||
|
while True :
|
||||||
|
|
||||||
|
# if bp_auto():
|
||||||
|
# voy_auto(True)
|
||||||
|
|
||||||
|
# Monter le store
|
||||||
|
if bp_m():
|
||||||
|
mot_d(False)
|
||||||
|
mot_m(True)
|
||||||
|
if fdc_h() :
|
||||||
|
mot_m(False)
|
||||||
|
|
||||||
|
# Descendre le store
|
||||||
|
if bp_d():
|
||||||
|
mot_m(False)
|
||||||
|
mot_d(True)
|
||||||
|
if fdc_b() :
|
||||||
|
mot_d(False)
|
||||||
|
|
||||||
|
# Arrêt
|
||||||
|
if bp_a():
|
||||||
|
mot_m(False)
|
||||||
|
mot_d(False)
|
||||||
|
# voy_auto(False)
|
||||||
|
|
||||||
|
|
||||||
|
fin() # A garder
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# En: External call << DONT CHANGE THIS SECTION >>
|
||||||
|
# Fr: Appel externe << NE PAS MODIFIER CETTE SECTION >>
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
if __name__=='start':
|
||||||
|
thread_cmd_start(commandes)
|
||||||
|
if __name__=='stop':
|
||||||
|
thread_cmd_stop()
|
@ -0,0 +1,91 @@
|
|||||||
|
from volrou_lib import * # Bibliothèque volet roulant
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# volrou_cmd.py
|
||||||
|
# @title: Commandes du volet roulant
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Instructions élémentaires pour le volet roulant
|
||||||
|
#
|
||||||
|
# Actions (ordre = True ou False) :
|
||||||
|
# - Monter le volet (moteur sens trigo) : mot_m(True | False)
|
||||||
|
# - Descendre le volet (moteur sens horaire) : mot_d(True | False)
|
||||||
|
#
|
||||||
|
# Capteurs (valeur retournée = True ou False) :
|
||||||
|
# - Capteur fin de course volet en haut : fdc_h()
|
||||||
|
# - Capteur fin de course volet en bas : fdc_b()
|
||||||
|
# - Capteur de luminosité (LDR) : lum()
|
||||||
|
#
|
||||||
|
# Consignes du pupitre (valeur retournée = True ou False) :
|
||||||
|
# - Bouton poussoir monter volet : bp_m()
|
||||||
|
# - Bouton poussoir arrêt volet : bp_a()
|
||||||
|
# - Bouton poussoir descendre volet : bp_d()
|
||||||
|
# - Bouton poussoir mode automatique : bp_auto()
|
||||||
|
#
|
||||||
|
# Retour d'information du pupitre (allumer = True ou False) :
|
||||||
|
# - Voyant témoin mode automatique : voy_auto(True | False)
|
||||||
|
#
|
||||||
|
# Gestion du temps :
|
||||||
|
# - Temporisation en seconde : tempo(duree)
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
# Brochage du volet roulant
|
||||||
|
brochage={}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Fonctions
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Commandes
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
def commandes():
|
||||||
|
|
||||||
|
# Mise en place : Fermeture
|
||||||
|
print ("Volet roulant uniquement en mode manuel (sans le mode automatique)")
|
||||||
|
print ("Mise en place : Monter le store")
|
||||||
|
while fdc_h() ==False :
|
||||||
|
mot_d(False)
|
||||||
|
mot_m(True)
|
||||||
|
mot_m(False)
|
||||||
|
|
||||||
|
# Fonctionnement normal
|
||||||
|
print ("Attente")
|
||||||
|
while True :
|
||||||
|
|
||||||
|
# Monter le store
|
||||||
|
if bp_m():
|
||||||
|
print ("Monter le store ...")
|
||||||
|
mot_d(False)
|
||||||
|
mot_m(True)
|
||||||
|
if fdc_h() :
|
||||||
|
mot_m(False)
|
||||||
|
|
||||||
|
# Descendre le store
|
||||||
|
if bp_d():
|
||||||
|
print ("Descendre le store ...")
|
||||||
|
mot_m(False)
|
||||||
|
mot_d(True)
|
||||||
|
if fdc_b() :
|
||||||
|
mot_d(False)
|
||||||
|
|
||||||
|
# Arrêt
|
||||||
|
if bp_a():
|
||||||
|
print ("Arrêter le store")
|
||||||
|
mot_m(False)
|
||||||
|
mot_d(False)
|
||||||
|
|
||||||
|
fin() # A garder
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# En: External call << DONT CHANGE THIS SECTION >>
|
||||||
|
# Fr: Appel externe << NE PAS MODIFIER CETTE SECTION >>
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
if __name__=='start':
|
||||||
|
thread_cmd_start(commandes)
|
||||||
|
if __name__=='stop':
|
||||||
|
thread_cmd_stop()
|
@ -0,0 +1,93 @@
|
|||||||
|
from volrou_lib import * # Bibliothèque volet roulant
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# volrou_cmd.py
|
||||||
|
# @title: Commandes du volet roulant
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Instructions élémentaires pour le volet roulant
|
||||||
|
#
|
||||||
|
# Actions (ordre = True ou False) :
|
||||||
|
# - Monter le volet (moteur sens trigo) : mot_m(True | False)
|
||||||
|
# - Descendre le volet (moteur sens horaire) : mot_d(True | False)
|
||||||
|
#
|
||||||
|
# Capteurs (valeur retournée = True ou False) :
|
||||||
|
# - Capteur fin de course volet en haut : fdc_h()
|
||||||
|
# - Capteur fin de course volet en bas : fdc_b()
|
||||||
|
# - Capteur de luminosité (LDR) : lum()
|
||||||
|
#
|
||||||
|
# Consignes du pupitre (valeur retournée = True ou False) :
|
||||||
|
# - Bouton poussoir monter volet : bp_m()
|
||||||
|
# - Bouton poussoir arrêt volet : bp_a()
|
||||||
|
# - Bouton poussoir descendre volet : bp_d()
|
||||||
|
# - Bouton poussoir mode automatique : bp_auto()
|
||||||
|
#
|
||||||
|
# Retour d'information du pupitre (allumer = True ou False) :
|
||||||
|
# - Voyant témoin mode automatique : voy_auto(True | False)
|
||||||
|
#
|
||||||
|
# Gestion du temps :
|
||||||
|
# - Temporisation en seconde : tempo(duree)
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
# Brochage du volet roulant
|
||||||
|
brochage={}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Fonctions
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Commandes
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
def commandes():
|
||||||
|
|
||||||
|
# Mise en place : Fermeture
|
||||||
|
print ("Volet roulant uniquement en mode manuel (sans le mode automatique)")
|
||||||
|
print ("Mise en place : Monter le store")
|
||||||
|
while fdc_h() ==False :
|
||||||
|
mot_d(False)
|
||||||
|
mot_m(True)
|
||||||
|
mot_m(False)
|
||||||
|
|
||||||
|
# Fonctionnement normal
|
||||||
|
print ("Attente")
|
||||||
|
while True :
|
||||||
|
|
||||||
|
# Monter le store
|
||||||
|
if bp_m():
|
||||||
|
print ("Monter le store ...")
|
||||||
|
mot_d(False)
|
||||||
|
mot_m(True)
|
||||||
|
|
||||||
|
# Descendre le store
|
||||||
|
if bp_d():
|
||||||
|
print ("Descendre le store ...")
|
||||||
|
mot_m(False)
|
||||||
|
mot_d(True)
|
||||||
|
|
||||||
|
# Arrêt du moteur
|
||||||
|
if fdc_h() :
|
||||||
|
mot_m(False)
|
||||||
|
if fdc_b() :
|
||||||
|
mot_d(False)
|
||||||
|
|
||||||
|
# Arrêt
|
||||||
|
if bp_a():
|
||||||
|
print ("Arrêter le store")
|
||||||
|
mot_m(False)
|
||||||
|
mot_d(False)
|
||||||
|
|
||||||
|
fin() # A garder
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# En: External call << DONT CHANGE THIS SECTION >>
|
||||||
|
# Fr: Appel externe << NE PAS MODIFIER CETTE SECTION >>
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
if __name__=='start':
|
||||||
|
thread_cmd_start(commandes)
|
||||||
|
if __name__=='stop':
|
||||||
|
thread_cmd_stop()
|
63
Lycee/programmation_python/si/volet_roulant/volrou_cmd.py
Normal file
63
Lycee/programmation_python/si/volet_roulant/volrou_cmd.py
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
from volrou_lib import * # Bibliothèque volet roulant
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# volrou_cmd.py
|
||||||
|
# @title: Commandes du volet roulant
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Instructions élémentaires pour le volet roulant
|
||||||
|
#
|
||||||
|
# Actions (ordre = True ou False) :
|
||||||
|
# - Monter le volet (moteur sens trigo) : mot_m(True | False)
|
||||||
|
# - Descendre le volet (moteur sens horaire) : mot_d(True | False)
|
||||||
|
#
|
||||||
|
# Capteurs (valeur retournée = True ou False) :
|
||||||
|
# - Capteur fin de course volet en haut : fdc_h()
|
||||||
|
# - Capteur fin de course volet en bas : fdc_b()
|
||||||
|
# - Capteur de luminosité (LDR) : lum()
|
||||||
|
#
|
||||||
|
# Consignes du pupitre (valeur retournée = True ou False) :
|
||||||
|
# - Bouton poussoir monter volet : bp_m()
|
||||||
|
# - Bouton poussoir arrêt volet : bp_a()
|
||||||
|
# - Bouton poussoir descendre volet : bp_d()
|
||||||
|
# - Bouton poussoir mode automatique : bp_auto()
|
||||||
|
#
|
||||||
|
# Retour d'information du pupitre (allumer = True ou False) :
|
||||||
|
# - Voyant témoin mode automatique : voy_auto(True | False)
|
||||||
|
#
|
||||||
|
# Gestion du temps :
|
||||||
|
# - Temporisation en seconde : tempo(duree)
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
# Brochage du volet roulant
|
||||||
|
brochage={}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Fonctions
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Commandes
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
def commandes():
|
||||||
|
|
||||||
|
# Ecrire votre code ici ...
|
||||||
|
voy_auto(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':
|
||||||
|
thread_cmd_start(commandes)
|
||||||
|
if __name__=='stop':
|
||||||
|
thread_cmd_stop()
|
Loading…
x
Reference in New Issue
Block a user