I got a problem connecting my PCB with tpic6c595dr (shift register). To my raspberry pi. I couldnt find a rasp pi forum.
Ive got the code below very simple.
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
datapin = 17 # serial pin
clockpin = 27 # srclk
latchpin = 22 # rclk
GPIO.setup(datapin, GPIO.OUT)
GPIO.setup(clockpin, GPIO.OUT)
GPIO.setup(latchpin, GPIO.OUT)
GPIO.output(latchpin, 0)
leds = "11111011"
for x in range(8):
GPIO.output(datapin, int(leds[x-1]))
time.sleep(0.01)
GPIO.output(clockpin, 1)
time.sleep(0.01)
GPIO.output(clockpin, 0)
time.sleep(0.01)
GPIO.output(latchpin, 1)
And i have the schematic attached as a pdf.
I cant control the lights.
I connected the serial pin to 17 srclk to 27 rclk to 22 and clr to 5V. The lights automatically all turn when powered which i dont understand. I cant control them individually do you guys have any idea what im doing wrong?
rclkPin should have a pulse that goes LOW > HIGH > LOW, you are leaving it HIGH until you call the setLEDS() function again. I don't see that as really causing a problem though.