***moderator please mark solved or delete. figured out defective breadboard.
running following example code. cannot leds light unless put in 1 of leds backwards. others work plus backwards 1 stays on. please help.
running following example code. cannot leds light unless put in 1 of leds backwards. others work plus backwards 1 stays on. please help.
code: [select]
//pin connected st_cp of 74hc595
int latchpin = 8;
//pin connected sh_cp of 74hc595
int clockpin = 12;
////pin connected ds of 74hc595
int datapin = 11;
void setup() {
//set pins output can control shift register
pinmode(latchpin, output);
pinmode(clockpin, output);
pinmode(datapin, output);
}
void loop() {
// count 0 255 , display number
// on leds
for (int numbertodisplay = 0; numbertodisplay < 256; numbertodisplay++) {
// take latchpin low
// leds don't change while you're sending in bits:
digitalwrite(latchpin, low);
// shift out bits:
shiftout(datapin, clockpin, msbfirst, numbertodisplay);
//take latch pin high leds light up:
digitalwrite(latchpin, high);
// pause before next value:
delay(500);
}
}
***moderator please mark solved or deleteyou can things yourself. there "more..." menu under post.
Arduino Forum > Using Arduino > LEDs and Multiplexing > [SOLVED] SHIFTOUT not working
arduino
Comments
Post a Comment