Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # MorePi Me v1 Demo by @tymkrs
- def update():
- for index in range(0, 32):
- if state[32 - index]:
- GPIO.output(DataPin, GPIO.HIGH)
- else:
- GPIO.output(DataPin, GPIO.LOW)
- GPIO.output(ClockPin, GPIO.HIGH)
- GPIO.output(ClockPin, GPIO.LOW)
- GPIO.output(LatchPin, GPIO.HIGH)
- GPIO.output(LatchPin, GPIO.LOW)
- def clear():
- for index in range(0, 32):
- state[index] = False
- state = [False for index in range(33)]
- LatchPin = 11
- ClockPin = 13
- DataPin = 15
- import time
- import RPi.GPIO as GPIO
- GPIO.setwarnings(False)
- GPIO.setmode(GPIO.BOARD)
- GPIO.setup(LatchPin, GPIO.OUT) #latch
- GPIO.setup(ClockPin, GPIO.OUT) #clock
- GPIO.setup(DataPin, GPIO.OUT) #data
- while True:
- for n in range(0, 8):
- clear()
- state[n + 1] = True
- update()
- time.sleep(.03)
- for n in range(0, 8):
- clear()
- state[8 - n] = True
- update()
- time.sleep(.03)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement