niveaux
This commit is contained in:
@@ -2701,7 +2701,7 @@
|
||||
"type": "ui-text",
|
||||
"z": "86a34ee77bf6db10",
|
||||
"group": "b7568fe107ccb2e6",
|
||||
"order": 5,
|
||||
"order": 2,
|
||||
"width": "1",
|
||||
"height": "1",
|
||||
"name": "",
|
||||
@@ -3372,7 +3372,7 @@
|
||||
"type": "ui-text",
|
||||
"z": "86a34ee77bf6db10",
|
||||
"group": "b7568fe107ccb2e6",
|
||||
"order": 2,
|
||||
"order": 5,
|
||||
"width": "1",
|
||||
"height": "1",
|
||||
"name": "",
|
||||
|
||||
52
main.cpp
52
main.cpp
@@ -65,57 +65,7 @@ void process()
|
||||
VOTRE PROGRAMME COMMENCE ICI
|
||||
**************************************************************** */
|
||||
|
||||
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);
|
||||
|
||||
actionneur[0] = actionneur[2] = actionneur[4] = 1;
|
||||
/* ****************************************************************
|
||||
VOTRE PROGRAMME S'ARRETE ICI
|
||||
**************************************************************** */
|
||||
|
||||
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