Ajout gestion VL53L8

This commit is contained in:
Samuel 2024-04-03 22:46:16 +02:00
parent c8452307fc
commit ace9a932d2

View File

@ -136,18 +136,19 @@ uint8_t i2c_annexe_get_tension_batterie(void){
void i2c_annexe_get_VL53L8(enum validite_vl53l8_t *validite, float * angle, float * distance){
union float_or_octet_t donnee;
*validite = donnees_reception[ADRESSE_VL53L8_VALIDITE];
donnee.octet[0]= donnees_reception[ADRESSE_VL53L8_ANGLE];
donnee.octet[1]= donnees_reception[ADRESSE_VL53L8_ANGLE+1];
donnee.octet[2]= donnees_reception[ADRESSE_VL53L8_ANGLE+2];
donnee.octet[3]= donnees_reception[ADRESSE_VL53L8_ANGLE+3];
*validite = donnees_reception[ADRESSE_VL53L8_VALIDITE - ADRESSE_DEBUT_R];
donnee.octet[0]= donnees_reception[ADRESSE_VL53L8_ANGLE - ADRESSE_DEBUT_R];
donnee.octet[1]= donnees_reception[ADRESSE_VL53L8_ANGLE+1 - ADRESSE_DEBUT_R];
donnee.octet[2]= donnees_reception[ADRESSE_VL53L8_ANGLE+2 - ADRESSE_DEBUT_R];
donnee.octet[3]= donnees_reception[ADRESSE_VL53L8_ANGLE+3 - ADRESSE_DEBUT_R];
*angle = donnee.f_value;
donnee.octet[0]= donnees_reception[ADRESSE_VL53L8_DISTANCE];
donnee.octet[1]= donnees_reception[ADRESSE_VL53L8_DISTANCE+1];
donnee.octet[2]= donnees_reception[ADRESSE_VL53L8_DISTANCE+2];
donnee.octet[3]= donnees_reception[ADRESSE_VL53L8_DISTANCE+3];
donnee.octet[0]= donnees_reception[ADRESSE_VL53L8_DISTANCE - ADRESSE_DEBUT_R];
donnee.octet[1]= donnees_reception[ADRESSE_VL53L8_DISTANCE+1 - ADRESSE_DEBUT_R];
donnee.octet[2]= donnees_reception[ADRESSE_VL53L8_DISTANCE+2 - ADRESSE_DEBUT_R];
donnee.octet[3]= donnees_reception[ADRESSE_VL53L8_DISTANCE+3 - ADRESSE_DEBUT_R];
*distance = donnee.f_value;
}