niveaux
This commit is contained in:
50
pp.txt
Normal file
50
pp.txt
Normal file
@@ -0,0 +1,50 @@
|
||||
if (etape == 0 && capteur[1] == 0) {
|
||||
etape = 10;
|
||||
tempo = millis();
|
||||
}
|
||||
|
||||
// Etape 10 : 1 moteur allumé
|
||||
if (etape == 10 && capteur[1] == 0 && millis() >= tempo + 2000) {
|
||||
etape = 12;
|
||||
tempo = millis();
|
||||
}
|
||||
|
||||
if (etape == 10 && capteur[2] == 1 && millis() >= tempo + 2000) {
|
||||
etape = 0;
|
||||
}
|
||||
|
||||
// Etape 12 : 2 moteur allumés
|
||||
if (etape == 12 && capteur[1] == 0 && millis() >= tempo + 2000) {
|
||||
etape = 14;
|
||||
tempo = millis();
|
||||
}
|
||||
|
||||
if (etape == 12 && capteur[2] == 1 && millis() >= tempo + 2000) {
|
||||
etape = 10;
|
||||
tempo = millis();
|
||||
}
|
||||
|
||||
// Etape 14 : 3 moteur allumés
|
||||
if (etape == 14 && capteur[1] == 0 && millis() >= tempo + 2000) {
|
||||
etape = 16;
|
||||
tempo = millis();
|
||||
}
|
||||
|
||||
if (etape == 14 && capteur[2] == 1 && millis() >= tempo + 2000) {
|
||||
etape = 12;
|
||||
tempo = millis();
|
||||
}
|
||||
|
||||
// Etape 16 : 4 moteur allumés
|
||||
if (etape == 16 && capteur[2] == 1) {
|
||||
etape = 14;
|
||||
tempo = millis();
|
||||
}
|
||||
|
||||
/* ****************************************************************
|
||||
LES ACTIONS
|
||||
**************************************************************** */
|
||||
moteur[0] = (etape == 10 || etape == 12 || etape == 14 || etape == 16);
|
||||
moteur[1] = (etape == 12 || etape == 14 || etape == 16);
|
||||
moteur[2] = (etape == 14 || etape == 16);
|
||||
moteur[3] = (etape == 16);
|
||||
Reference in New Issue
Block a user