From 49a5d3d3fb0dccf1b993aeea4b803cd079a1e66f Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 7 Mar 2022 10:08:56 +0100 Subject: feat: uncomment sensor value printing in loop function --- src/gyronardo.cpp | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'src/gyronardo.cpp') diff --git a/src/gyronardo.cpp b/src/gyronardo.cpp index 63b4bfc..d8aaf0e 100644 --- a/src/gyronardo.cpp +++ b/src/gyronardo.cpp @@ -71,14 +71,10 @@ void setup() << "Gyro Z: " << sensor.gyro_cal_z << "\n"; sout << "Starting..." << endl; - - sout << "Pitch: " << sensor.getPitch() << " " - << "Roll: " << sensor.getRoll() << endl; } void loop() { - /* delay(SENSOR_THROTTLE_TIME); if (!sensor.read()) @@ -87,25 +83,14 @@ void loop() if (status == SensorStatus::THROTTLED) { - printSerial("Warning: The sensor was read too frequently and throttled"); - endl(); - + sout << "Warning: The sensor was read too frequently and throttled" << endl; return; } - printSerial("Error: Failed to read sensor. Status: %d", static_cast(status)); - endl(); - + sout << "Error: Failed to read sensor. Status: " << static_cast(status) + << endl; stop(); } - char *pitch = floatToStr(sensor.getPitch(), FLOAT_WIDTH, FLOAT_PRECISION); - char *roll = floatToStr(sensor.getRoll(), FLOAT_WIDTH, FLOAT_PRECISION); - - printSerial("\rPitch: %s Roll: %s", pitch, roll); - Serial.flush(); - - free(pitch); - free(roll); - */ + sout << "Pitch: " << sensor.getPitch() << " Roll: " << sensor.getRoll() << endl; } -- cgit v1.2.3-18-g5258