I built the circuit from the arduino ShiftOut tutorial, but it is not working as expected. I made a simulation model and that one isn't working either.
The code I used is from the tutorial:
// SH_CP; 11
const int clockPin = 9;
// DS; 15
const int dataPin = 8;
// ST_CP; 12
const int latchPin = 10;
void setup() {
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(latchPin, OUTPUT);
Serial.begin(9600);
Serial.println("reset");
}
void loop() {
for (int number = 0; number < 256; number++) {
Serial.println(number);
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, number);
digitalWrite(latchPin, HIGH);
delay(500);
}
}
Any idea as to what's wrong?