Skip to content

Commit

Permalink
Bitbangio writes incorrectly in registers
Browse files Browse the repository at this point in the history
in connection with #20
tested on max31856 (phase 1) and st7735R (phase 0) on a raspberry pico/u2if.
Also solves the problem of a max31856 on raspberry pi (impossible to set the thresholds)
  • Loading branch information
Linkeor authored Dec 11, 2023
1 parent ce94f55 commit 325f600
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adafruit_bitbangio.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,13 @@ def write(
# Set clock to base
if not self._phase: # Mode 0, 2
self._mosi.value = bit_value
self._sclk.value = self._polarity
self._sclk.value = not self._polarity
start_time = self._wait(start_time)

# Flip clock off base
if self._phase: # Mode 1, 3
self._mosi.value = bit_value
self._sclk.value = not self._polarity
self._sclk.value = self._polarity
start_time = self._wait(start_time)

# Return pins to base positions
Expand Down

0 comments on commit 325f600

Please sign in to comment.