user34682: 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?

user17164: I presume that you are referring to this tutorial, and this code.
The clockPin of Arduino should be connected to pin 11(SH_CP) of 595, dataPin to pin 14(DS), and latchPin to pin 12(ST_CP).
Swap the values of clockPin and latchPin in your code, and you should be good to go.
// SH_CP; 11
const int clockPin = 10;
// DS; 14 (not 15)
const int dataPin = 8;
// ST_CP; 12
const int latchPin = 9;


34682: <p>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.
<a href="https://i.stack.imgur.com/9H0a6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9H0a6.png" alt="Simulation I built"></a></p>

<p>The code I used is from the tutorial:</p>

<pre><code>// 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 &lt; 256; number++) {
    Serial.println(number);
    digitalWrite(latchPin, LOW);
    shiftOut(dataPin, clockPin, MSBFIRST, number);
    digitalWrite(latchPin, HIGH);
    delay(500);
  }
}
</code></pre>

<p>Any idea as to what's wrong?</p>
 17164: <p>I presume that you are referring to <a href="https://www.arduino.cc/en/Tutorial/ShiftOut" rel="nofollow noreferrer" title="Serial to Parallel Shifting-Out with a 74HC595">this tutorial</a>, and <a href="https://www.arduino.cc/en/Tutorial/ShftOut11" rel="nofollow noreferrer">this code</a>.</p>

<p>The <code>clockPin</code> of Arduino should be connected to pin 11(SH_CP) of 595, <code>dataPin</code> to pin 14(DS), and <code>latchPin</code> to pin 12(ST_CP).</p>

<p>Swap the values of <code>clockPin</code> and <code>latchPin</code> in your code, and you should be good to go.</p>

<pre><code>// SH_CP; 11
const int clockPin = 10;
// DS; 14 (not 15)
const int dataPin = 8;
// ST_CP; 12
const int latchPin = 9;
</code></pre>
