I want to connect a pcb with 74hc595 to a raspberry pi.
When i connect it de lights are all on on stsrtup which is no problem but i cant seem to get them to go off.
This is the diagram.
I got the data pin connected to 16
Clock to 20
Latch to 21
This is my code for testing:
Things i tried so far are:
Grounding the /OE made no difference
Testing chip on seperate breadboard this did work.
Switching power supply.
Adding a pull down resistor to the serial pin which seemed to float.
Non of which made a difference.
Does someone have any idea what it might be?
Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'
Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination
https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum
Please post your full sketch, using code tags when you do
Posting your code using code tags prevents parts of it being interpreted as HTML coding and makes it easier to copy for examination
In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.
It is also helpful to post error messages in code tags as it makes it easier to scroll through them and copy them for examination
With the 595, When OE is low this enable the outputs, When OE is high this disables them, it shouldn't be left floating and should be set to one state or the other.
Placing OE in the HIGH state should turn the LEDs off, but this alone wont check for actual shifting function. Reset when toggled low and high again should clear the shift registers too.
I would personally set up a single 595 with your PI and get that working first, Are the LEDs you're driving connected to ground with 5V provided from the 595 output, if so and if all the LEDs are on before you do anything that suggests an issue.
or are the LEDs are connected to 5V and the 595 is grounding them to turn them on ?
You should also place 0.1uF or so decoupling capacitors between VCC and Ground on each 595 as well.