Created
October 27, 2019 10:03
-
-
Save sixtyfive/18cb87cd0eb2b7c88705bb213c06eb35 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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