Pages: [1]   Go Down
Author Topic: Can't Use Pin 8 On the 74hc595 Shift Register  (Read 270 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
shifter.setAll(HIGH);
shifter.write();
delay(500);
but when I use
Code:
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:
#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);

}
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18771
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Yes, this shift register has 8 outputs
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 485
Posts: 18771
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

0, 1, 2, 3, 4, 5, 6, 7

^^
8 outputs.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: