Skip to content

Commit 49e181e

Browse files
profbradytannewt
authored andcommitted
Update simpleio.py
added clock pin toggle for shift_out
1 parent f38e550 commit 49e181e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

simpleio.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,14 @@ def shift_out(dataPin, clock, value, msb_first=True):
122122
"""
123123
value = value&0xFF
124124
for i in range(0, 8):
125+
clock.value = True
125126
if msb_first:
126127
tmpval = bool(value & (1 << (7-i)))
127128
dataPin.value = tmpval
128129
else:
129130
tmpval = bool((value & (1 << i)))
130131
dataPin.value = tmpval
132+
clock.value = False
131133

132134
class Servo:
133135
"""

0 commit comments

Comments
 (0)