Affichage du score
This commit is contained in:
		
							parent
							
								
									51bba9dc23
								
							
						
					
					
						commit
						f45038d104
					
				
							
								
								
									
										11
									
								
								Test.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								Test.c
									
									
									
									
									
								
							| @ -548,9 +548,12 @@ int test_i2c_ecriture_pico_annex_nb_2(){ | ||||
|     printf("U - Turbine Off\n"); | ||||
|     printf("P - Propulseur On\n"); | ||||
|     printf("M - Propulseur Off\n"); | ||||
|     printf("S - Score + 1\n"); | ||||
|      | ||||
| 
 | ||||
|     int lettre; | ||||
|     int continue_test=1; | ||||
|     uint8_t score=0; | ||||
| 
 | ||||
|     time_i2c[0] = time_us_32(); | ||||
|     time_i2c[1] = time_us_32(); | ||||
| @ -605,6 +608,12 @@ int test_i2c_ecriture_pico_annex_nb_2(){ | ||||
|                     printf("Quitte\n"); | ||||
|                     break; | ||||
| 
 | ||||
|                 case 's': | ||||
|                 case 'S': | ||||
|                     score++; | ||||
|                     i2c_annexe_envoie_score(score); | ||||
|                     break; | ||||
|                  | ||||
|                 default: | ||||
|                     printf("lettre non reconnue: %d %c\n", lettre, lettre); | ||||
|             } | ||||
| @ -735,7 +744,7 @@ int test_aller_retour(){ | ||||
| 
 | ||||
|         case 'c': | ||||
|         case 'C': | ||||
|             Trajet_config(TRAJECT_CONFIG_AVANCE_DROIT); | ||||
|             Trajet_config(TRAJECT_CONFIG_AVANCE_ET_TOURNE); | ||||
|             Trajectoire_circulaire(&trajectoire, 0, 250, -90, 90, 250, 0, 0); | ||||
|             printf("Trajectoire circulaire\n"); | ||||
|             break; | ||||
|  | ||||
| @ -5,6 +5,7 @@ | ||||
| #define ADRESSE_PICO_ANNEXE 0x17 | ||||
| #define ADRESSE_DEBUT_W 0x05 | ||||
| #define ADRESSE_DEBUT_R 0x0A | ||||
| #define ADRESSE_SCORE 0x09 | ||||
| #define ADRESSE_TURBINE_PORTE 0x0A | ||||
| #define ADRESSE_CONTACTEURS 0x0B | ||||
| #define ADRESSE_VL53L1X 0x0C | ||||
| @ -101,6 +102,11 @@ void i2c_annexe_desactive_propulseur(void){ | ||||
|     donnees_a_envoyer=1; | ||||
| } | ||||
| 
 | ||||
| void i2c_annexe_envoie_score(uint8_t score){ | ||||
|     donnees_emission[ADRESSE_SCORE - ADRESSE_DEBUT_W] = score; | ||||
|     donnees_a_envoyer=1; | ||||
| } | ||||
| 
 | ||||
| uint8_t i2c_annexe_get_contacteur_butee_A(void){ | ||||
|     return (donnees_reception[ADRESSE_CONTACTEURS - ADRESSE_DEBUT_R] >> 3) & 0x01; | ||||
| } | ||||
|  | ||||
| @ -13,6 +13,8 @@ void i2c_annexe_ferme_porte(void); | ||||
| void i2c_annexe_active_propulseur(void); | ||||
| void i2c_annexe_desactive_propulseur(void); | ||||
| 
 | ||||
| void i2c_annexe_envoie_score(uint8_t score); | ||||
| 
 | ||||
| uint8_t i2c_annexe_get_contacteur_butee_A(void); | ||||
| uint8_t i2c_annexe_get_contacteur_butee_C(void); | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user