Travail en cours - le bout qui n'était pas sauvegardé
This commit is contained in:
parent
ede90afdd9
commit
9b9cffec43
20
main.c
20
main.c
@ -103,8 +103,8 @@ int bouton_appui(uint8_t bouton)
|
||||
{
|
||||
etat_bouton[bouton] = gpio_get(bouton);
|
||||
}
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void main()
|
||||
@ -142,9 +142,9 @@ void main()
|
||||
while (1)
|
||||
{
|
||||
// Voie X
|
||||
result1 = AdcRead1()/16;
|
||||
result1 = AdcRead1() / 16;
|
||||
// Voie Y
|
||||
result0 = AdcRead0()/16;
|
||||
result0 = AdcRead0() / 16;
|
||||
|
||||
message[0] = result0;
|
||||
message[1] = 255 - result1;
|
||||
@ -228,7 +228,8 @@ void main()
|
||||
// Optimisation : lorsque la pince est fermée et l'ascenseur au niveau milieu, la pince s'ouvre, l'ascenseur monte et le robot recule
|
||||
}
|
||||
else if((ascenceur == ASCENSEUR_LACHE_POT_JARDINIERE && pince == PINCE_POT) ||
|
||||
(ascenceur == ASCENSEUR_LACHE_PLANTE && pince == PINCE_PLANTE)){
|
||||
(ascenceur == ASCENSEUR_LACHE_PLANTE && pince == PINCE_PLANTE))
|
||||
{
|
||||
pince = PINCE_OUVERTE;
|
||||
message [3] = pince;
|
||||
communication_envoyer_message(message, 254);
|
||||
@ -245,7 +246,8 @@ void main()
|
||||
communication_envoyer_message(message, 254);
|
||||
sleep_ms(1000);
|
||||
}
|
||||
else{
|
||||
else
|
||||
{
|
||||
ascenceur = ASCENSEUR_HAUT;
|
||||
}
|
||||
}
|
||||
@ -253,24 +255,26 @@ void main()
|
||||
message [3] = pince;
|
||||
message[4] = ascenceur;
|
||||
|
||||
|
||||
printf(">x:%d\n", message[0]);
|
||||
printf(">Y:%d\n", message[1]);
|
||||
printf(">Rz:%d\n", message[2]);
|
||||
printf(">pince:%d\n", message[3]);
|
||||
printf(">ascenceur:%d\n", message[4]);
|
||||
printf(">result0:%d\n", result0);
|
||||
|
||||
sleep_ms(25);
|
||||
|
||||
communication_envoyer_message(message, 254);
|
||||
}
|
||||
/*
|
||||
M1_INITIALISE();
|
||||
|
||||
while(1)
|
||||
{
|
||||
M1_AVANCE();
|
||||
sleep_ms(1000);
|
||||
M1_RECULE();
|
||||
sleep_ms(1000);
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user