adafruit / Adafruit_CircuitPython_seesaw

seesaw helper IC driver for circuitPython
MIT License
64 stars 36 forks source link

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

Closed logandgsmith closed 9 months ago

logandgsmith commented 1 year 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 9 months ago

Nice catch. Thanks!