summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-07 10:08:56 +0100
committerHampusM <hampus@hampusmat.com>2022-03-07 10:08:56 +0100
commit49a5d3d3fb0dccf1b993aeea4b803cd079a1e66f (patch)
treed733c14f6a3af3f9ed19ce7eddeaedfc6e93d10a /src
parentda2ec747227ac1716326bd076219c7f7a2bb3887 (diff)
feat: uncomment sensor value printing in loop function
Diffstat (limited to 'src')
-rw-r--r--src/gyronardo.cpp23
1 files changed, 4 insertions, 19 deletions
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<int>(status));
- endl();
-
+ sout << "Error: Failed to read sensor. Status: " << static_cast<int>(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;
}