Go Down

Topic: Can't Use Pin 8 On the 74hc595 Shift Register (Read 411 times) previous topic - next topic

jreeve17

Hi, I just got my first shift registers and am learning how to use them. I found this site- http://bildr.org/2011/08/74hc595-breakout-arduino/ There was a great library there that made it easier to use this shift register and I am using it now. The only problem is that I can't individually control pin 8. The pin works fine and responds normally when using
Code: [Select]
shifter.setAll(HIGH);
shifter.write();
delay(500);

but when I use
Code: [Select]
shifter.setPin(8, HIGH);
shifter.write();
delay(500);
the pin does nothing.
Can anyone help me with this problem and tell me what I am doing wrong? Any help would be appreciated.

This is a rather lengthy sketch that I wrote to test out this problem-
Code: [Select]

#include <Shifter.h>

#define SER_Pin 4 //SER_IN
#define RCLK_Pin 5 //L_CLOCK
#define SRCLK_Pin 6 //CLOCK

#define NUM_REGISTERS 1 //how many registers are in the chain


//initaize shifter using the Shifter library
Shifter shifter(SER_Pin, RCLK_Pin, SRCLK_Pin, NUM_REGISTERS);

void setup(){
shifter.clear();
shifter.write();
delay(100);
}

void loop(){

shifter.setPin(1, HIGH);
shifter.write();
delay(500);

shifter.clear();
shifter.write();
delay(100);

shifter.setPin(2, HIGH);
shifter.write();
delay(500);

shifter.clear();
shifter.write();
delay(100);

shifter.setPin(3, HIGH);
shifter.write();
delay(500);

shifter.clear();
shifter.write();
delay(100);

shifter.setPin(4, HIGH);
shifter.write();
delay(500);

shifter.clear();
shifter.write();
delay(100);

shifter.setPin(5, HIGH);
shifter.write();
delay(500);

shifter.clear();
shifter.write();
delay(100);

shifter.setPin(6, HIGH);
shifter.write();
delay(500);

shifter.clear();
shifter.write();
delay(100);

shifter.setPin(7, HIGH);
shifter.write();
delay(500);

shifter.clear();
shifter.write();
delay(100);

shifter.setPin(8, HIGH);
shifter.write();
delay(500);

shifter.clear();
shifter.write();
delay(100);

shifter.setAll(HIGH);
shifter.write();
delay(500);

shifter.clear();
shifter.write();
delay(100);

}

Nick Gammon

Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

jreeve17


Are you sure it isn't 7? (Pins 0 to 7)


Yes, this shift register has 8 outputs

Nick Gammon

Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

jreeve17

YES! Thank you that worked. I was using pins 1-8 not 0-7. Thank you so much.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy