adafruit / Adafruit_CircuitPython_seesaw

seesaw helper IC driver for circuitPython
MIT License
60 stars 35 forks source link

Update seesaw_quadrotary.py to change color of neopixel based on direction of rotation #126

Closed logandgsmith closed 7 months ago

logandgsmith commented 9 months ago

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.

caternuson commented 7 months ago

Nice catch. Thanks!