From fd2f05047e5ad8c4746a7272926ae3541a4a44a6 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Mon, 26 Aug 2019 21:09:59 -0700 Subject: [PATCH] Update wheeldrop example Now prints status of each wheel to screen. Signed-off-by: Jacob Perron --- examples/wheeldrop.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/wheeldrop.cpp b/examples/wheeldrop.cpp index 5564539..59e02e6 100644 --- a/examples/wheeldrop.cpp +++ b/examples/wheeldrop.cpp @@ -64,13 +64,18 @@ int main(int argc, char** argv) { while (!robot->isCleanButtonPressed()) { // Get wheeldrop status - const bool wheeldrop = robot->isWheeldrop(); + const bool wheeldrop_left = robot->isLeftWheeldrop(); + const bool wheeldrop_right = robot->isRightWheeldrop(); // Print status - std::cout << "\rWheeldrop status: " << wheeldrop; + std::cout << "\rWheeldrop status (left and right): [ " << + wheeldrop_left << + ", " << + wheeldrop_right << + " ]"; // If dropped, then make light red - if (wheeldrop) + if (wheeldrop_left || wheeldrop_right) robot->setPowerLED(255); // Red else robot->setPowerLED(0); // Green