From 16f50c9447101581c6fb7d72bdab16b430be0f2e Mon Sep 17 00:00:00 2001 From: Samuel Date: Sat, 20 May 2023 00:15:08 +0200 Subject: [PATCH] Pilotage du bras "pousse gateau" --- Test.c | 14 ++++++++++++++ i2c_annexe.c | 9 +++++++++ i2c_annexe.h | 3 +++ 3 files changed, 26 insertions(+) diff --git a/Test.c b/Test.c index a1f3840..fce97bf 100644 --- a/Test.c +++ b/Test.c @@ -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); diff --git a/i2c_annexe.c b/i2c_annexe.c index d9d8f31..598b3ec 100644 --- a/i2c_annexe.c +++ b/i2c_annexe.c @@ -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; diff --git a/i2c_annexe.h b/i2c_annexe.h index 2bfe9cc..70a4138 100644 --- a/i2c_annexe.h +++ b/i2c_annexe.h @@ -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); \ No newline at end of file