Update wheeldrop example
Now prints status of each wheel to screen. Signed-off-by: Jacob Perron <jacobmperron@gmail.com>
This commit is contained in:
parent
4a0f8ad72b
commit
fd2f05047e
1 changed files with 8 additions and 3 deletions
|
@ -64,13 +64,18 @@ int main(int argc, char** argv) {
|
||||||
|
|
||||||
while (!robot->isCleanButtonPressed()) {
|
while (!robot->isCleanButtonPressed()) {
|
||||||
// Get wheeldrop status
|
// Get wheeldrop status
|
||||||
const bool wheeldrop = robot->isWheeldrop();
|
const bool wheeldrop_left = robot->isLeftWheeldrop();
|
||||||
|
const bool wheeldrop_right = robot->isRightWheeldrop();
|
||||||
|
|
||||||
// Print status
|
// 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 dropped, then make light red
|
||||||
if (wheeldrop)
|
if (wheeldrop_left || wheeldrop_right)
|
||||||
robot->setPowerLED(255); // Red
|
robot->setPowerLED(255); // Red
|
||||||
else
|
else
|
||||||
robot->setPowerLED(0); // Green
|
robot->setPowerLED(0); // Green
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue