Suppression du printf du fil d'execution principal
This commit is contained in:
parent
f192d31c1e
commit
c19ddc685c
@ -31,7 +31,7 @@ target_link_libraries(Detection2023
|
||||
hardware_uart
|
||||
hardware_pio
|
||||
pico_stdlib
|
||||
|
||||
pico_multicore
|
||||
)
|
||||
|
||||
pico_enable_stdio_usb(Detection2023 1)
|
||||
|
@ -121,7 +121,6 @@ int continuous_multiple_reading(){
|
||||
printf("GetDistance KO, error %d, capteur:%x\n", status, device);
|
||||
return 0;
|
||||
}else{
|
||||
printf(">distance%x:%d\n", device, distance_mm);
|
||||
if(distance_mm < DISTANCE_TROP_LOIN_CM * 10){
|
||||
distance_capteur_cm[device-0x31] = distance_mm / 10;
|
||||
}else{
|
||||
|
30
main.c
30
main.c
@ -1,5 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include "pico/stdlib.h"
|
||||
#include "pico/multicore.h"
|
||||
#include "hardware/i2c.h"
|
||||
#include "VL53L1X_Fonctions.h"
|
||||
#include "SelectionCapteur.h"
|
||||
@ -29,7 +30,7 @@ int continuous_multiple_reading(void);
|
||||
void affiche_distance_sur_led();
|
||||
void init_sensors(void);
|
||||
|
||||
|
||||
uint8_t tampon_commande_led[3];
|
||||
|
||||
#define I2C_SLAVE_ADDRESS 0x18
|
||||
#define ADRESSE_RECEPTION_DATA 0x10
|
||||
@ -103,10 +104,33 @@ static void setup_slave() {
|
||||
}
|
||||
|
||||
|
||||
void blink(void){
|
||||
const uint LED_PIN = PICO_DEFAULT_LED_PIN;
|
||||
while(1){
|
||||
printf("couleur_Led:%2x\n", tampon_commande_led[0]);
|
||||
printf("masque_Led:%3x\n", (tampon_commande_led[1]<<8) | tampon_commande_led[2]);
|
||||
|
||||
for(uint8_t capteur=0; capteur<12; capteur++){
|
||||
printf(">distance%x:%d\n", capteur, context.mem[capteur]);
|
||||
}
|
||||
|
||||
gpio_put(LED_PIN, !gpio_get(LED_PIN));
|
||||
sleep_ms(20);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
int status;
|
||||
uint8_t tampon_commande_led[3];
|
||||
|
||||
const uint LED_PIN = PICO_DEFAULT_LED_PIN;
|
||||
gpio_init(LED_PIN);
|
||||
gpio_set_dir(LED_PIN, GPIO_OUT);
|
||||
gpio_put(LED_PIN, 1);
|
||||
|
||||
tampon_commande_led[0]=0;
|
||||
tampon_commande_led[1]=0;
|
||||
tampon_commande_led[2]=0;
|
||||
@ -125,6 +149,8 @@ void main(void)
|
||||
|
||||
//Tests();
|
||||
|
||||
multicore_launch_core1(blink);
|
||||
|
||||
initialise_adresses();
|
||||
while(1){
|
||||
// Lecture des capteurs
|
||||
|
Loading…
Reference in New Issue
Block a user