#include #include #include float choice = 0.0; float accx, accy, accz; float pressure; void receivedData(); void setup() { if (!IMU.begin()) { while (1); } if (!BARO.begin()) { while (1); } PhyphoxBLE::start(); PhyphoxBLE::configHandler=&receivedData; } void loop() { if(choice == 1.0){ if (IMU.accelerationAvailable()) { IMU.readAcceleration(accx, accy, accz); PhyphoxBLE::write(accx, accy, accz); } }else if(choice == 2.0){ pressure = BARO.readPressure(); PhyphoxBLE::write(pressure); }else{ } } void receivedData(){ PhyphoxBLE::read(choice); }