Pilotage du bras "pousse gateau"

This commit is contained in:
Samuel 2023-05-20 00:15:08 +02:00
parent 727197d9f4
commit 16f50c9447
3 changed files with 26 additions and 0 deletions

14
Test.c
View File

@ -567,6 +567,8 @@ int test_i2c_ecriture_pico_annex_nb_2(){
printf("P - Propulseur On\n");
printf("M - Propulseur Off\n");
printf("S - Score + 1\n");
printf("B - Bras deplie\n");
printf("N - Bras plie 1\n");
int lettre;
@ -649,6 +651,18 @@ int test_i2c_ecriture_pico_annex_nb_2(){
score++;
i2c_annexe_envoie_score(score);
break;
case 'b':
case 'B':
i2c_annexe_deplie_bras();
printf("=> Deplie bras\n");
break;
case 'n':
case 'N':
i2c_annexe_plie_bras();
printf("=> Plie bras\n");
break;
default:
printf("lettre non reconnue: %d %c\n", lettre, lettre);

View File

@ -115,6 +115,15 @@ void i2c_annexe_desactive_deguisement(void){
donnees_a_envoyer=1;
}
void i2c_annexe_deplie_bras(void){
donnees_emission[ADRESSE_TURBINE_PORTE - ADRESSE_DEBUT_W] |= 0x20;
donnees_a_envoyer=1;
}
void i2c_annexe_plie_bras(void){
donnees_emission[ADRESSE_TURBINE_PORTE - ADRESSE_DEBUT_W] &= 0xDF;
donnees_a_envoyer=1;
}
void i2c_annexe_envoie_score(uint8_t score){
donnees_emission[ADRESSE_SCORE - ADRESSE_DEBUT_W] = score;
donnees_a_envoyer=1;

View File

@ -28,4 +28,7 @@ void i2c_annexe_couleur_balise(uint8_t couleur, uint16_t masque_led);
void i2c_annexe_active_deguisement(void);
void i2c_annexe_desactive_deguisement(void);
void i2c_annexe_plie_bras(void);
void i2c_annexe_deplie_bras(void);
uint8_t i2c_annexe_get_tension_batterie(void);