Skip to content

Conversation

@logandgsmith
Copy link
Contributor

@logandgsmith logandgsmith commented Nov 25, 2023

Moved last_position[n] = rotary_pos to after the if ( rotary_pos > last_positions[n]): block.

Without this, last_position[n] was being overwritten before it was compared to rotary_pos. This was causing if ( rotary_pos > last_positions[n]): to always evaluate to False which meant that colors would only move in one direction regardless of if the encoder was rotated clockwise or counterclockwise.

Move `last_position[n] = rotary_pos` to after current position is evaluated. Without this, `last_position[n]` was being overwritten before it was compared to `rotary_pos`.
@caternuson
Copy link
Contributor

Nice catch. Thanks!

@caternuson caternuson merged commit 3109848 into adafruit:main Feb 6, 2024
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Feb 21, 2024
Updating https://github.com/adafruit/Adafruit_CircuitPython_IRRemote to 4.1.19 from 4.1.18:
  > Merge pull request adafruit/Adafruit_CircuitPython_IRRemote#67 from Kry-Vosa/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display to 3.12.4 from 3.12.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_RGB_Display#119 from reza-n/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_Seesaw to 1.16.3 from 1.16.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_seesaw#126 from logandgsmith/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_asyncio to 1.3.1 from 1.3.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_asyncio#64 from kbsriram/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_HID to 6.1.0 from 6.0.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_HID#124 from pythonmcpi/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_IterTools to 2.0.8 from 2.0.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_IterTools#20 from kbsriram/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 7.5.9 from 7.5.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#203 from justmobilize/simplify-socket-exceptions

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Updated download stats for the libraries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants