Workshop example
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Diff: main.cpp
- Revision:
- 16:70374ab2404f
- Parent:
- 15:a0430d40a918
- Child:
- 17:fc98adcf835a
--- a/main.cpp Mon Dec 10 22:06:50 2018 +0000 +++ b/main.cpp Tue Dec 11 00:25:58 2018 +0000 @@ -30,7 +30,7 @@ static LPS22HBSensor sen_press_temp(&devI2c); static LSM6DSLSensor sen_acc_gyro(&devI2c,LSM6DSL_ACC_GYRO_I2C_ADDRESS_LOW,PD_11); // low address static LIS3MDL sen_mag(&devI2c); -static DigitalOut shutdown_pin(PC_6); +// static DigitalOut shutdown_pin(PC_6); // static VL53L0X sen_distance(&devI2c, &shutdown_pin, PC_7); #define SENSORS_POLL_INTERVAL 1.0 @@ -205,14 +205,17 @@ } #endif /* SEND_ALL_SENSORS */ - // if (sen_distance.get_distance(&uval) == VL53L0X_ERROR_NONE) { - // printf("VL53L0X [mm]: %6ld\r\n", uval); - // if (endpointInfo) { - // res_distance->set_value((float)uval); - // } - // } else { - // printf("VL53L0X [mm]: --\r\n"); - // } +// if (sen_distance.get_distance(&uval) == VL53L0X_ERROR_NONE) { +// printf("VL53L0X [mm]: %6ld\r\n", uval); +// #ifdef SEND_ALL_SENSORS +// if (endpointInfo) res_distance->set_value((float)uval); +// #endif /* SEND_ALL_SENSORS */ +// } else { +// printf("VL53L0X [mm]: --\r\n"); +// #ifdef SEND_ALL_SENSORS +// if (endpointInfo) res_distance->set_value(99999.9); +// #endif /* SEND_ALL_SENSORS */ +// } printf("\033[6A"); } @@ -222,7 +225,7 @@ // If the User button is pressed ons start, then format storage. const int PRESSED = 0; - DigitalIn *user_button = new DigitalIn(USER_BUTTON); + DigitalIn *user_button = new DigitalIn(BUTTON1); if (user_button->read() == PRESSED) { printf("User button is pushed on start. Formatting the storage...\n"); int storage_status = fs.reformat(&sd);