175 bhy2_quaternion_to_euler(data_ptr, &roll, &pitch, &yaw);
191 Serial.begin(115200);
198 bhy.setFirmware(bosch_firmware_image, bosch_firmware_size);
209 Serial.println(
"Initializing Sensors...");
211#ifdef USE_I2C_INTERFACE
216 Serial.print(
"Failed to initialize sensor - error code:");
217 Serial.println(
bhy.getError());
224#ifdef USE_SPI_INTERFACE
227 Serial.print(
"Failed to initialize sensor - error code:");
228 Serial.println(
bhy.getError());
235 Serial.println(
"Initializing the sensor successfully!");
238 BoschSensorInfo info =
bhy.getSensorInfo();
241 ArduinoStreamPrinter printer(Serial);
242 info.printInfo(printer);
244 info.printInfo([](
const char *format, ...) ->
int {
246 va_start(args, format);
247 int result = vprintf(format, args);
286 float sample_rate = 100.0;
289 uint32_t report_latency_ms = 0;
291#ifdef USING_DATA_HELPER
292 quaternion.enable(sample_rate, report_latency_ms);
297 bhy.configure(BoschSensorID::GAME_ROTATION_VECTOR, sample_rate, report_latency_ms);
303#ifdef USING_SENSOR_IRQ_METHOD