Skip to content

Commit

Permalink
Encoders demo: fixed bug; bumped version to 1.0.3
Browse files Browse the repository at this point in the history
Since the first call to checkErrorLeft() and checkErrorRight() would
have already cleared the encoder error flags, calling those functions
again right away meant errors would never be reported on the display
unless an error occurred between the two calls.
  • Loading branch information
kevin-pololu committed Sep 7, 2022
1 parent 892dd43 commit 753524c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017-2020 Pololu Corporation (www.pololu.com)
Copyright (c) 2017-2022 Pololu Corporation (www.pololu.com)

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Romi32U4 library

Version: 1.0.2<br/>
Release date: 2017-07-17<br/>
[www.pololu.com](https://www.pololu.com/)

## Summary
Expand Down Expand Up @@ -76,6 +74,7 @@ For complete documentation, see https://pololu.github.io/romi-32u4-arduino-libra

## Version history

* 1.0.3 (2022-09-06): Fixed a bug in the Encoders demo that could prevent encoder errors from being shown properly on the display.
* 1.0.2 (2017-07-17): Fixed a bug that caused errors for the right encoder to be reported as errors for the left encoder.
* 1.0.1 (2017-02-23):
* Changed the internal `Romi32U4Motors::maxSpeed` variable to be an `int16_t` so it can be compared to other `int16_t` variables without warnings.
Expand Down
6 changes: 3 additions & 3 deletions examples/Encoders/Encoders.ino
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void loop()
bool errorLeft = encoders.checkErrorLeft();
bool errorRight = encoders.checkErrorRight();

if(encoders.checkErrorLeft())
if (errorLeft)
{
// An error occurred on the left encoder channel.
// Display it on the LCD for the next 10 iterations and
Expand All @@ -64,9 +64,9 @@ void loop()
buzzer.playFromProgramSpace(encoderErrorLeft);
}

if(encoders.checkErrorRight())
if (errorRight)
{
// An error occurred on the left encoder channel.
// An error occurred on the right encoder channel.
// Display it on the LCD for the next 10 iterations and
// also beep.
displayErrorRightCountdown = 10;
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Romi32U4
version=1.0.2
version=1.0.3
author=Pololu
maintainer=Pololu <[email protected]>
sentence=Romi 32U4 Arduino library
Expand Down

0 comments on commit 753524c

Please sign in to comment.