// led lillies control int relayPinArray[] = {3, 4, 5, 6, 7}; int randomArray[] = {2,7,4,1,8,8,9,5,3,6,2,2,6,5,2,4,5,3,7,2,2,2,8,4,9,9,9,2,5,5}; int analogNoisePin = 1; // wire connected for random int randomNoise = 0; // store the above int loopCounter = 0; void setup(){ int count; for (count=0;count<5;count++) { pinMode(relayPinArray[count], OUTPUT); } Serial.begin(9600); } void loop() { // val = analogRead(analogNoisePin); // read the input pin // simplePattern(); zzzzBrrBoaBoaBoa(); } void zzzzBrrBoaBoaBoa(){ int count; Serial.println(loopCounter); // for (count=0;count<5;count++) { // digitalWrite(relayPinArray[count], HIGH); // delay(20); // } for (count=0;count<5;count++) { loopCounter ++; digitalWrite(relayPinArray[count], LOW); delay(20); digitalWrite(relayPinArray[count], HIGH); delay(randomArray[loopCounter] * 200); } if (loopCounter > 30) { int i; for (i=0;i<100;i=i+10) { int j; for (j=0; j<5; j++) { digitalWrite(relayPinArray[j], HIGH); } delay(5); for (j=0; j<5; j++) { digitalWrite(relayPinArray[j], LOW); } delay(200-i); } loopCounter = 0; } } void simplePattern(){ int count; for (count=0;count<5;count++) { digitalWrite(relayPinArray[count], HIGH); delay(200); } delay(5000); for (count=0;count<5;count++) { digitalWrite(relayPinArray[count], LOW); delay(200); } }