cfredisded
Active member
Hi all, its my first time ever using 74hc595s with the teensy, and I'm going to be working on a bar graph type project. So I have four 595s hooked up to the teensy and wanted to try the library 'Shifty' to make things a bit easier for me. But I cant get any leds to turn on or off. Ive tried a sketch just to test the shift registers but haven't had any luck. Here's my schematic https://imgur.com/gmv0wg7 and here's the program I've tried. I have it all hooked up like this on a circuit board I made.
In this code I added the digitalWrite(21, HIGH); and digitalWrite(21, LOW); just to make sure the teensy was working in this setup and that led does blink but nothing on the bar graph blinks.
I'm also curious as to which pins need to be used for clock latch and data. Do I have to use 13, 11 and 8? im going off of this site. https://www.pjrc.com/teensy/td_libs_ShiftPWM.html
Any help tips would be appreciated, Thanks.
Code:
#include <Shifty.h>
// Declare the shift register
Shifty shift;
void setup() {
// Set the number of bits you have (multiples of 8)
shift.setBitCount(32);
// Set the clock, data, and latch pins you are using
// This also sets the pinMode for these pins
shift.setPins(13, 11, 8);
pinMode(21, OUTPUT);
}
void loop() {
// writeBit works just like digitalWrite
shift.writeBit(1, HIGH);
digitalWrite(21, HIGH);
delay(500);
shift.writeBit(3, HIGH);
delay(500);
shift.writeBit(1, LOW);
digitalWrite(21, LOW);
delay(500);
shift.writeBit(3, LOW);
delay(500);
}
I'm also curious as to which pins need to be used for clock latch and data. Do I have to use 13, 11 and 8? im going off of this site. https://www.pjrc.com/teensy/td_libs_ShiftPWM.html
Any help tips would be appreciated, Thanks.