Skip to content

Commit 325f600

Browse files
authored
Bitbangio writes incorrectly in registers
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)
1 parent ce94f55 commit 325f600

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_bitbangio.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -398,13 +398,13 @@ def write(
398398
# Set clock to base
399399
if not self._phase: # Mode 0, 2
400400
self._mosi.value = bit_value
401-
self._sclk.value = self._polarity
401+
self._sclk.value = not self._polarity
402402
start_time = self._wait(start_time)
403403

404404
# Flip clock off base
405405
if self._phase: # Mode 1, 3
406406
self._mosi.value = bit_value
407-
self._sclk.value = not self._polarity
407+
self._sclk.value = self._polarity
408408
start_time = self._wait(start_time)
409409

410410
# Return pins to base positions

0 commit comments

Comments
 (0)