Skip to content

Instantly share code, notes, and snippets.

@hgdeoro
Created May 17, 2011 04:57
Show Gist options
  • Save hgdeoro/975974 to your computer and use it in GitHub Desktop.
Save hgdeoro/975974 to your computer and use it in GitHub Desktop.
Test 74HC164 shift register with Py-Arduino-Proxy
# Test 74HC164 shift register
import time
from arduino_proxy import ArduinoProxy
def blink():
print "blink()"
proxy.shiftOut(10, 11, ArduinoProxy.LSBFIRST, 0)
time.sleep(0.5)
proxy.shiftOut(10, 11, ArduinoProxy.LSBFIRST, 255)
time.sleep(0.5)
# Replace /dev/ttyACM0 with the device for your Arduino (it may be /dev/ttyACM1 or another)
proxy = ArduinoProxy('/dev/ttyACM0')
proxy.shiftOut(10, 11, ArduinoProxy.LSBFIRST, 0,
set_pin_mode=True)
blink()
blink()
blink()
for i in range(0, 256):
print i
proxy.shiftOut(10, 11, ArduinoProxy.LSBFIRST, i)
blink()
blink()
blink()
for i in range(255, -1, -1):
print i
proxy.shiftOut(10, 11, ArduinoProxy.LSBFIRST, i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment