user87029: I am making a 7x10 led matrix and I am having problems with the shiftout function. It is only able to show me the output in one shiftout register at a time. How can I fix it?

For example:
void setup(){
    // PORTB as output.
    // Pin 13: Clock 74HC595
    // Pin 12: Latch
    // Pin 11: Data
    // Pin 10: Reset
    // Pin 9: Clock CD4017
    DDRB = 0b111111;
    // Makes sure the 4017 value is 0.
    PORTB = 0b100;
    delayMicroseconds(5);
    PORTB = 0;
}

void loop(){
  shiftOut(11, 13, LSBFIRST, 0b1000111101);
  PORTB = 0b10000;
  delayMicroseconds(800);
  PORTB = 0;
  delay(10000);
}

This is the output it produces:

But with numbers of 8 bits or less the output is displayed correctly.
shiftOut(11, 13, LSBFIRST, 0b10001111);


user4143: shiftOut works on bytes. To do more than one byte you have to do more than one shiftOut. Also you have to take note of the bit ordering. You should shift the most significant bit first, not the least.
For example, this:
  shiftOut(11, 13, LSBFIRST, 0b1000111101);

should be:
  shiftOut(11, 13, MSBFIRST, 0b10);
  shiftOut(11, 13, MSBFIRST, 0b00111101);


user42015: Have a look at the implementation of shiftOut() (you can find it where you installed the Arduino IDE in the file hardware/arduino/avr/cores/arduino/wiring_shift.c):
void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val)
{
  uint8_t i;

  for (i = 0; i < 8; i++)  {
    if (bitOrder == LSBFIRST) {
      digitalWrite(dataPin, val & 1);
      val >>= 1;
    } else {
      digitalWrite(dataPin, (val & 128) != 0);
      val <<= 1;
    }

    digitalWrite(clockPin, HIGH);
    digitalWrite(clockPin, LOW);
  }
}

Do you see, that the value (parameter val) is of type uint8_t, so only 1 byte big? And do you see, that the for loop only counts to 8 (one iteration for each bit in a byte)? This means, that the shiftOut() function only handles one byte at a time. When you want to shift out more bits than 8, you need to call it repeatedly.
In your first example the code behaves accordingly. The provided data gets cast to uint8_t, cutting away the upper 2 bits.

87029: <p>I am making a 7x10 led matrix and I am having problems with the shiftout function. It is only able to show me the output in one shiftout register at a time. How can I fix it?
<a href="https://i.stack.imgur.com/uxGrU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uxGrU.png" alt="enter image description here" /></a></p>
<p>For example:</p>
<pre><code>void setup(){
    // PORTB as output.
    // Pin 13: Clock 74HC595
    // Pin 12: Latch
    // Pin 11: Data
    // Pin 10: Reset
    // Pin 9: Clock CD4017
    DDRB = 0b111111;
    // Makes sure the 4017 value is 0.
    PORTB = 0b100;
    delayMicroseconds(5);
    PORTB = 0;
}

void loop(){
  shiftOut(11, 13, LSBFIRST, 0b1000111101);
  PORTB = 0b10000;
  delayMicroseconds(800);
  PORTB = 0;
  delay(10000);
}
</code></pre>
<p>This is the output it produces:</p>
<p><a href="https://i.stack.imgur.com/9AXCu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9AXCu.png" alt="enter image description here" /></a></p>
<p>But with numbers of 8 bits or less the output is displayed correctly.</p>
<p>shiftOut(11, 13, LSBFIRST, 0b10001111);
<a href="https://i.stack.imgur.com/DBcas.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DBcas.png" alt="enter image description here" /></a></p>
 4143: <p><code>shiftOut</code> works on bytes. To do more than one byte you have to do more than one <code>shiftOut</code>. Also you have to take note of the bit ordering. You should shift the most significant bit first, not the least.</p>
<p>For example, this:</p>
<pre class="lang-cpp prettyprint-override"><code>  shiftOut(11, 13, LSBFIRST, 0b1000111101);
</code></pre>
<p>should be:</p>
<pre class="lang-cpp prettyprint-override"><code>  shiftOut(11, 13, MSBFIRST, 0b10);
  shiftOut(11, 13, MSBFIRST, 0b00111101);
</code></pre>
 42015: <p>Have a look at the implementation of <code>shiftOut()</code> (you can find it where you installed the Arduino IDE in the file <code>hardware/arduino/avr/cores/arduino/wiring_shift.c</code>):</p>
<pre><code>void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val)
{
  uint8_t i;

  for (i = 0; i &lt; 8; i++)  {
    if (bitOrder == LSBFIRST) {
      digitalWrite(dataPin, val &amp; 1);
      val &gt;&gt;= 1;
    } else {
      digitalWrite(dataPin, (val &amp; 128) != 0);
      val &lt;&lt;= 1;
    }

    digitalWrite(clockPin, HIGH);
    digitalWrite(clockPin, LOW);
  }
}
</code></pre>
<p>Do you see, that the value (parameter <code>val</code>) is of type <code>uint8_t</code>, so only 1 byte big? And do you see, that the for loop only counts to 8 (one iteration for each bit in a byte)? This means, that the <code>shiftOut()</code> function only handles one byte at a time. When you want to shift out more bits than 8, you need to call it repeatedly.</p>
<p>In your first example the code behaves accordingly. The provided data gets cast to <code>uint8_t</code>, cutting away the upper 2 bits.</p>
