Skip to content

Instantly share code, notes, and snippets.

@sixtyfive
Created October 27, 2019 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sixtyfive/18cb87cd0eb2b7c88705bb213c06eb35 to your computer and use it in GitHub Desktop.
Save sixtyfive/18cb87cd0eb2b7c88705bb213c06eb35 to your computer and use it in GitHub Desktop.
#include <ShiftRegister74HC595.h>
int numberOfShiftRegisters = 2;
int numberOfCapacitorsToPop = 16;
int serialDataPin = 0;
int clockPin = 1;
int latchPin = 2;
int outputEnablePin = 3;
ShiftRegister74HC595 sr (numberOfShiftRegisters, serialDataPin, clockPin, latchPin);
void setup() {
pinMode(outputEnablePin, OUTPUT);
digitalWrite(outputEnablePin, HIGH);
sr.setAllHigh();
delay(3000);
digitalWrite(outputEnablePin, LOW);
randomSeed(analogRead(0));
for (int i=0; i<numberOfCapacitorsToPop; i++) {
sr.set(i, LOW);
delay(50);
sr.set(i, HIGH);
int randnum = 100 + random(500);
delay(randnum);
}
}
void loop() {
// HAPPY DIVALIIIIIIIIIIIII!!!!!!!!!!!!!!!! :-D :-* <3 <3 <3 <3 <3 <3
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment