help for code in example shift register 74hc595

hello im jonny from indonesian

now, i do a basic training for arduino with shift register (74HC595) from

and i have a trouble for code below.

lets see for code

//Pin connected to ST_CP of 74HC595
int latchPin = 8;
//Pin connected to SH_CP of 74HC595
int clockPin = 12;
////Pin connected to DS of 74HC595
int dataPin = 11;



void setup() {
  //set pins to output so you can control the shift register
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
  // count from 0 to 255 and display the number 
  // on the LEDs
  for (int numberToDisplay = 0; numberToDisplay < 256; numberToDisplay++) {
    // take the latchPin low so 
    // the LEDs don't change while you're sending in bits:
    digitalWrite(latchPin, LOW);
    // shift out the bits:
    shiftOut(dataPin, clockPin, MSBFIRST, numberToDisplay); 

    //take the latch pin high so the LEDs will light up:
    digitalWrite(latchPin, HIGH);
    // pause before next value:
    delay(500);
  }
}

shiftOut(dataPin, clockPin, MSBFIRST, numberToDisplay);
and my question ? what inside code void for "shiftOut" ? anyone know?

thx and regard from indonesia arduino beginner XD

The code is within all the many megabytes of stuff you downloaded to install the arduino IDE. Do some browsing in the folders, you can find it.

The code basically does:
clock pin low
data pin high or low as needed
clock pin high

clock pin low
data pin high or low as needed
clock pin high

repeat 6 more times

If you using single LEDS, and you have things wired up correctly, you will see (0 = off, 1 = on):
00000000
00000001
00000010
00000011
00000100
00000101
00000110
00000111
etc., up to
11111100
11111101
11111110
11111111

CrossRoads:
The code is within all the many megabytes of stuff you downloaded to install the arduino IDE. Do some browsing in the folders, you can find it.

The code basically does:
clock pin low
data pin high or low as needed
clock pin high

clock pin low
data pin high or low as needed
clock pin high

repeat 6 more times

If you using single LEDS, and you have things wired up correctly, you will see (0 = off, 1 = on):
00000000
00000001
00000010
00000011
00000100
00000101
00000110
00000111
etc., up to
11111100
11111101
11111110
11111111

okay thx ... problem solved :smiley: