186 Serial.begin(115200);
192 Serial.println(
"Initializing Sensors...");
209#ifdef USE_I2C_INTERFACE
214 Serial.print(
"Failed to initialize sensor - error code:");
215 Serial.println(
bhy.getError());
222#ifdef USE_SPI_INTERFACE
225 Serial.print(
"Failed to initialize sensor - error code:");
226 Serial.println(
bhy.getError());
233 Serial.println(
"Initializing the sensor successfully!");
236 BoschSensorInfo info =
bhy.getSensorInfo();
239 ArduinoStreamPrinter printer(Serial);
240 info.printInfo(printer);
242 info.printInfo([](
const char *format, ...) ->
int {
244 va_start(args, format);
245 int result = vprintf(format, args);
256 float sample_rate = 2.0;
257 uint32_t report_latency_ms = 0;
264#ifdef USING_DATA_HELPER
267 pressure.enable(sample_rate, report_latency_ms);
270 rslt =
bhy.configure(BoschSensorID::TEMPERATURE, sample_rate, report_latency_ms);
271 printResult(BoschSensorID::TEMPERATURE, sample_rate, rslt);
272 rslt =
bhy.configure(BoschSensorID::BAROMETER, sample_rate, report_latency_ms);
273 printResult(BoschSensorID::BAROMETER, sample_rate, rslt);
274 rslt =
bhy.configure(BoschSensorID::HUMIDITY, sample_rate, report_latency_ms);
275 printResult(BoschSensorID::HUMIDITY, sample_rate, rslt);
277 Serial.println(
"Register sensor result callback function");
283#ifdef USING_SENSOR_IRQ_METHOD