I'm trying to hookup an Nano Every to a TPIC6C595 shift register on my bread board with no luck.
The shift register is wired this way:
- Pin 1 - Vcc : 5V from arduino
- PIN 2 - SIN : D9 (data_in)
- PIN 7 - CLR : 5V+ with a 10k resistor (pull high)
- PIN 8 - G : GND (pull down)
- PIN 10- RCK : D11 (latch_pin)
- PIN15-SRCK : D10 (clock_pin)
- PIN 16 - GND : GND from arduino
For the test, it's powered by the Arduino via the USB cable connected to my computer.
I have a 0,1uf capacitor between shif register VCC and GND.
Leds are connected to the 5V+, then trough a resistor, and finally to shift register outputs pins (drains).
I can't get nothing out of it, any idea ?
I've tried with a regular Nano, but no luck too...
Are the cheap breadboard and wire jumpers might be the reason ? How I know if they are of quality ?
My test sketch is :
#include <Arduino.h>
// Define pins
#define DATA_PIN 9 // Connect to DS (pin 2) of TPIC6C595
#define CLOCK_PIN 10 // Connect to SRCK (pin 15) of TPIC6C595
#define LATCH_PIN 11 // Connect to RCK (pin 10) of TPIC6C595
// Define number of LEDs
#define NUM_LEDS 8
void clearLEDs();
// Define LED patterns
byte patterns[] = {
B00000001,
B00000010,
B00000100,
B00001000,
B00010000,
B00100000,
B01000000,
B10000000};
void setup()
{
// Initialize serial communication for debugging
Serial.begin(9600);
// Set pins as output
pinMode(DATA_PIN, OUTPUT);
pinMode(CLOCK_PIN, OUTPUT);
pinMode(LATCH_PIN, OUTPUT);
}
void loop()
{
// Loop through each LED pattern
for (int i = 0; i < NUM_LEDS; i++)
{
// Shift out data for current LED pattern
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, patterns[i]);
// Latch the data to update the outputs
digitalWrite(LATCH_PIN, HIGH);
digitalWrite(LATCH_PIN, LOW);
// Delay for visualization (you can adjust the delay as needed)
delay(500);
// Clear the LEDs for next pattern
clearLEDs();
}
}
// Function to clear all LEDs
void clearLEDs()
{
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, B00000000);
digitalWrite(LATCH_PIN, HIGH);
digitalWrite(LATCH_PIN, LOW);
}
