réservoir
This commit is contained in:
83
exercice1.txt
Normal file
83
exercice1.txt
Normal file
@@ -0,0 +1,83 @@
|
||||
ci = (c0 == 1 && c1 == 1 && c2 == 0 && c3 == 0 && c5 == 0 && c6 == 0);
|
||||
|
||||
if (marche_frontmontant == 1 && ci == 1)
|
||||
{
|
||||
mode_auto = 1;
|
||||
etape = 1;
|
||||
}
|
||||
|
||||
if (i0 = 1) {
|
||||
mode_manu = 1;
|
||||
mode_auto = 0;
|
||||
}
|
||||
|
||||
if (arret_frontdescedant == 1)
|
||||
{
|
||||
mode_auto = 0;
|
||||
}
|
||||
|
||||
if (etape == 1 && c6 == 1 && ((b0_frontmontant && mode_manu) || mode_auto))
|
||||
{
|
||||
etape = 2;
|
||||
}
|
||||
|
||||
if (etape == 2 && c2 == 1 && b0_frontmontant)
|
||||
{
|
||||
etape = 3;
|
||||
}
|
||||
|
||||
if (etape == 3 && tempo == 0 && b0_frontmontant)
|
||||
{
|
||||
tempo = millis();
|
||||
}
|
||||
|
||||
if (etape == 3 && millis() > tempo + 3000)
|
||||
{
|
||||
etape = 4;
|
||||
tempo = 0;
|
||||
}
|
||||
|
||||
if (etape == 4 && c1 == 1 && b0_frontmontant)
|
||||
{
|
||||
etape = 5;
|
||||
}
|
||||
|
||||
if (etape == 5 && c3 == 1 && b0_frontmontant == 1)
|
||||
{
|
||||
etape = 6;
|
||||
}
|
||||
|
||||
if (etape == 6 && c5_frontdescendant == 1)
|
||||
{
|
||||
etape = 7;
|
||||
}
|
||||
|
||||
if (etape == 7 && b0_frontmontant == 1) {
|
||||
etape = 1;
|
||||
}
|
||||
|
||||
s0 = mode_auto == 1;
|
||||
|
||||
if (ci && mode_auto == 0)
|
||||
{
|
||||
s8 = 1;
|
||||
}
|
||||
else if (ci && mode_auto == 1)
|
||||
{
|
||||
s8 = 2;
|
||||
}
|
||||
else if (mode_auto)
|
||||
{
|
||||
s8 = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
s8 = 0;
|
||||
}
|
||||
|
||||
s10 = etape;
|
||||
|
||||
a0 = (etape == 1);
|
||||
a1 = (etape == 2 || etape == 3);
|
||||
a2 = (etape == 5);
|
||||
a3 = (etape == 6);
|
||||
Reference in New Issue
Block a user