Redgeneral
Member
Hi
I've been trying to use the 74HC595 with the Teensy LC, but I'm not having much luck.
Although the end intent is to make a button matrix, I've been trying to test it using LEDs, but they do not light up at all.
My Circuit:
My Breadboard:
My Code (no error messages):
Additional testing:
Software: Arduino 1.8.8 and Teensyduino
Hardware: Teensy LC and 74HC595 (Texas Instruments SN74HC595N)
Additional Libraries: None
I'm not sure what I'm doing wrong and would be grateful for any help
Thank you
I've been trying to use the 74HC595 with the Teensy LC, but I'm not having much luck.
Although the end intent is to make a button matrix, I've been trying to test it using LEDs, but they do not light up at all.
My Circuit:
My Breadboard:
My Code (no error messages):
Code:
// teensy tto 74hc595 - column light up
//connections to 74hc595
int latchPin = 8;
int clockPin = 13;
int dataPin = 11;
// shifting values
byte patterns[8]={
B00000001,
B00000010,
B00000100,
B00001000,
B00010000,
B00100000,
B01000000,
B10000000
};
int current = 0;
int count = sizeof(patterns);
void setup() {
// set serial pins to output
pinMode(latchPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(clockPin, OUTPUT);
}
void loop() {
//write to shift registor
digitalWrite(latchPin,LOW);
shiftOut(dataPin, clockPin, MSBFIRST, patterns[current]);
digitalWrite(latchPin, HIGH);
delay(500);
//increase current
current++;
//reset current
if(current >= 8){
current = 0;
}
}
Additional testing:
- Tested each wire and LEDs
- Rechecked all LEDs are the right way round
- Teensy LC onboard LED (pin 13) flashes - so it is working
Software: Arduino 1.8.8 and Teensyduino
Hardware: Teensy LC and 74HC595 (Texas Instruments SN74HC595N)
Additional Libraries: None
I'm not sure what I'm doing wrong and would be grateful for any help
Thank you