#include <Arduino.h>
// SN74HC595 简称 N74
// ST 大平台  5
// DS 数据 4
// SH 活塞  6
const short N74_ST_BIG = 5;
const short N74_DS_DATA = 4;
const short N74_SH_PUSH = 6;

const int LED[] = {1,1,1,1,0,0,0,0,1,0,1,0,1,0,1,0};

void pull_push_data(short num); // 数据活塞 num:0或1

void setup()
{
  pinMode(N74_ST_BIG, OUTPUT);
  pinMode(N74_DS_DATA, OUTPUT);
  pinMode(N74_SH_PUSH, OUTPUT);
}

void loop()
{
  digitalWrite(N74_ST_BIG, LOW); // 放下大平台

  for (unsigned short i = 0; i < 16; i++)
  {
    pull_push_data(LED[i]);
  }

  digitalWrite(N74_ST_BIG, HIGH); // 拉起大平台
}

void pull_push_data(short num)
{
  digitalWrite(N74_SH_PUSH, LOW);  // 活塞拉回
  digitalWrite(N74_DS_DATA, num);  // 放入数据
  digitalWrite(N74_SH_PUSH, HIGH); // 活塞推动数据
}
74HC595
74HC595