Useful shift register with 12 outputs instead of the standard 8. Not much information is available for this chip. The data sheet uses some non-standard designations so here is some information that might help someone out.
What the datasheet calls "strobe" is normally called "latch." Pulsing this pin takes the information in the register and sends it to the output pins. The strobe pin must be pulsed after you shift in the data. This pin could be tied to 5V in a pinch but you might see some flickering as you shift through the data.
Output enable can be tied to 5V to be permanently active or driven with a PWM signal to dim the entire shift register.
Either QS1 or QS2 can be used as an output to daisy-chain to the next shift register. These pins have slightly different functionality related to rise time of the clock signal. QS2 is probably best for most applications.
//HEF4894B 12-bit Shift Register
int SRClock = 3; //Data shifted on positive-going clock transition
int SRData = 7; //Data transferred to storage register when strobe input is high.
int SROutputEnable = 5; //Data in storage register appears at output when Output Enable is high. Can be tied to 5V or Pulse Width Modulated.
int SRStrobe = 4; //Strobe = Latch data to outputs. Can be tied to 5V but you might see some flickering as the data is shifted through the register.
byte SRArrayData[12] = {1,1,1,1,1,1,0,0,0,0,0,0};
byte Counter = 0;
void setup(){
pinMode(SRData, 1);
pinMode(SRClock, 1);
pinMode(SROutputEnable, 1); digitalWrite(SROutputEnable, 1); //analogWrite(SROutputEnable, 10);
pinMode(SRStrobe, 1); digitalWrite(SRStrobe, 1);
}
void loop(){
digitalWrite(SRData, SRArrayData[Counter]);
delayMicroseconds(1);
digitalWrite(SRClock, 1);
delayMicroseconds(1);
digitalWrite(SRClock, 0);
Counter++;
if (Counter == 12){Counter = 0; digitalWrite(SRStrobe, 1); delayMicroseconds(1); digitalWrite(SRStrobe, 0);}
}