I've included the entire sketch below. (It's long, but is mostly setting variables for different color patterns depending on switch positions)
The power supply still works.
The board is a Mega
Thanks for all the info! I'll do some more testing when I get home tonight.
#include <FastLED.h>
byte RedV = 100; //variable for Red amount
byte GreenV = 100; //variable for green amount
byte BlueV = 100; //variable for blue amount
byte Lights = 0; //variable for state of lights (on,off,auto)
byte Old_Lights;
byte Pattern = 0 ; //variable for pattern
byte Old_Pattern;
byte Old_RedV;
byte Old_GreenV;
byte Old_BlueV;
byte RandomRed;
byte RandomGreen;
byte RandomBlue;
//---------------------LED STRIP 1-------------------------------
#define NUM_LEDS 150 //number of LEDs on garage
#define DATA_PIN 28 //data pin for lights
CRGB garage[NUM_LEDS]; //light array
//***************************************************************
//-------------------LED STRIP 2----------------------------------
#define NUM_LEDS2 150 // Lights on the house
#define DATA_PIN2 29 // Data pin for house lights
CRGB house[NUM_LEDS2]; //House light array
//***************************************************************
//----------------------LED STRIP 3------------------------------
#define NUM_LEDS3 150 // Lights on the handrail
#define DATA_PIN3 30 // Data pin for Handrail lights
CRGB handrail[NUM_LEDS3]; //handrail light array
//*************************************************************
//----------------------LED STRIP 4------------------------------
#define NUM_LEDS4 150 // EXTRA Light Strip
#define DATA_PIN4 31 // Data pin for Extra Light Strip
CRGB leds4[NUM_LEDS4]; //house light array
//*************************************************************
//---------------MOTION SENSOR STUFF---------------------------
byte GarageSensor = 22; //Garage motion sensor pin
byte pirValueG; //gets sets to 1 or 0 to set pin to high or low state
byte DoorSensor = 51; //Front Door Motion Sensor pin
byte pirValueD; //
//*************************************************************
void setup() {
Serial.begin(9600);
pinMode(GarageSensor, INPUT);
pinMode(DoorSensor, INPUT);
pinMode(2, INPUT_PULLUP); //turns lights on
pinMode(3, INPUT_PULLUP); // turns lights to auto
pinMode(4, INPUT_PULLUP); // sets pattern1 variable to 1
pinMode(5, INPUT_PULLUP); // sets pattern1 variable to 2
pinMode(6, INPUT_PULLUP); // sets pattern2 varibale to 3
pinMode(7, INPUT_PULLUP); // sets pattern2 variable to 4
pinMode(8, INPUT_PULLUP); // adjusts red value up
pinMode(9, INPUT_PULLUP); // adjust red value down
pinMode(10, INPUT_PULLUP); // adjusts green value up
pinMode(11, INPUT_PULLUP); // adjusts green value down
pinMode(12, INPUT_PULLUP); // adjusts blue value up
pinMode(13, INPUT_PULLUP); // adjusts blue value down
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(garage, NUM_LEDS); // LED strip 1 info
FastLED.addLeds<WS2812B, DATA_PIN2, GRB>(house, NUM_LEDS2); //LED Strip 2info
FastLED.addLeds<WS2812B, DATA_PIN3, GRB>(handrail, NUM_LEDS3); // LED Strip 3 info
FastLED.addLeds<WS2812B, DATA_PIN4, GRB>(leds4, NUM_LEDS4); //LED strip 4 info
}
void loop()
{
//-----------SETS "Lights" variable----------------------------
if (digitalRead (2) == LOW) {
Lights = 1;
}
if (digitalRead (3) == LOW) {
Lights = 2;
}
if (digitalRead (2) == HIGH && digitalRead (3) == HIGH) {
Lights = 0;
}
//---------------------displays the lights, pattern, and color variables on the serial monitor when there is a change in thier value-----------------------
if (Lights != Old_Lights) {
Serial.print("Lights=");
Serial.println(Lights, DEC);
Old_Lights = Lights;
}
if (Pattern != Old_Pattern) {
Serial.print("Pattern=");
Serial.println(Pattern, DEC);
Old_Pattern = Pattern;
}
if (RedV != Old_RedV) {
Serial.print("Red Value=");
Serial.println(RedV, DEC);
Serial.print("Green Value=");
Serial.println(GreenV, DEC);
Serial.print("Blue Value=");
Serial.println(BlueV, DEC);
Old_RedV = RedV;
}
if (GreenV != Old_GreenV) {
Serial.print("Red Value=");
Serial.println(RedV, DEC);
Serial.print("Green Value=");
Serial.println(GreenV, DEC);
Serial.print("Blue Value=");
Serial.println(BlueV, DEC);
Old_GreenV = GreenV;
}
if (BlueV != Old_BlueV) {
Serial.print("Red Value=");
Serial.println(RedV, DEC);
Serial.print("Green Value=");
Serial.println(GreenV, DEC);
Serial.print("Blue Value=");
Serial.println(BlueV, DEC);
Old_BlueV = BlueV;
}
//----------------------------------------------------------------------------------------------------------------------------------------------------
//*****************************************************************
//------------SETS THE "Pattern" VARIABLE---------------------------------------------------------------
if (digitalRead (4) == HIGH && digitalRead (5) == HIGH && digitalRead (6) == HIGH && digitalRead (7) == HIGH) {
Pattern = 0; //turns only garage lights on
}
if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == HIGH && digitalRead (7) == HIGH) {
Pattern = 1; // turns all lights on solid to color basecd on user set RGB values
}
if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == HIGH && digitalRead (7) == HIGH) {
Pattern = 2; // Turns all lights on twinkle based on user set RGB values
}
if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == LOW && digitalRead (7) == HIGH) {
Pattern = 3; // Turns all lights on solid based on Christmas pattern
}
if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == LOW && digitalRead (7) == HIGH) {
Pattern = 4; // Turns all lights on twinkle based on Christmas pattern
}
if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == HIGH && digitalRead (7) == LOW) {
Pattern = 5; // Turns all lights on solid based on Halloween pattern
}
if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == HIGH && digitalRead (7) == LOW) {
Pattern = 6; // Turns all lights on twinkle based on Halloween pattern
}
if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (8) == LOW) {
Pattern = 7; // Turns all lights on solid based on valetine pattern
}
if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (8) == LOW) {
Pattern = 8; // Turns all lights on Twinkle based on valetine pattern
}
if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (10) == LOW) {
Pattern = 9; // Turns all lights on solid based on St Patricks pattern
}
if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (10) == LOW) {
Pattern = 10; // Turns all lights on Twinkle based on St Patricks pattern
}
if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (12) == LOW) {
Pattern = 11; // Turns all lights on solid based on Water pattern
}
if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (12) == LOW) {
Pattern = 12; // Turns all lights on Twinkle based on Water pattern
if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (9) == LOW) {
Pattern = 13; // Turns all lights on solid based on Fire pattern
}
if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (9) == LOW) {
Pattern = 14; // Turns all lights on Twinkle based on Fire pattern
}
if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (11) == LOW) {
Pattern = 15; // Turns all lights on solid based on Gold and Silver pattern
}
if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (11) == LOW) {
Pattern = 16; // Turns all lights on Twinkle based on Gold and Silver pattern
}
if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (13) == LOW) {
Pattern = 17; // Turns all lights on solid based on Purple and Blue pattern
}
if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (13) == LOW) {
Pattern = 18; // Turns all lights on Twinkle based on Purple and Blue pattern
}
//*****************************************************************************************************************
//--------------Changes the Color values----------------------
if (digitalRead (8) == LOW && RedV < 255 ) {
RedV = RedV + 1; //increases RedV by 1 every cycle
}
if (digitalRead (9) == LOW && RedV > 0 ) {
RedV = RedV - 1; //Decreases RedV by 1 every cycle
}
if (digitalRead (10) == LOW && GreenV < 255 ) {
GreenV = GreenV + 1; //increases GreenV by 1 every cycle
}
if (digitalRead (11) == LOW && GreenV > 0 ) {
GreenV = GreenV - 1; //Drcreases GreenV by 1 every Cycle
}
if (digitalRead (12) == LOW && BlueV < 255 ) {
BlueV = BlueV + 1; //increaes BlueV by 1 every cycle
}
if (digitalRead (13) == LOW && BlueV > 0 ) {
BlueV = BlueV - 1; //decreases BlueV by 1 every cycle
}
//------------------TURN THE GARAGE and HANDRAIL LIGHTS ON SOLID to white ----------------------
if (Lights == 1 && Pattern == 0)
{
fill_solid( &(garage[0]), NUM_LEDS, CRGB(255, 255, 255));
fill_solid( &(house[0]), NUM_LEDS, CRGB(0, 0, 0));
fill_solid( &(handrail[0]), NUM_LEDS, CRGB(255, 255, 255));
fill_solid( &(leds4[0]), NUM_LEDS, CRGB(0, 0, 0));
FastLED.show();
}
//------------------MANUAL TURN ALL LIGHTS ON SOLID to user slected color----------------------
else if (Lights == 1 && Pattern == 1)
{
fill_solid( &(garage[0]), NUM_LEDS, CRGB(RedV, GreenV, BlueV));
fill_solid( &(house[0]), NUM_LEDS, CRGB(RedV, GreenV, BlueV));
fill_solid( &(handrail[0]), NUM_LEDS, CRGB(RedV, GreenV, BlueV));
fill_solid( &(leds4[0]), NUM_LEDS, CRGB(RedV, GreenV, BlueV));
FastLED.show();
}
//------------------AUTO TURN ALL LIGHTS ON SOLID to user slected color----------------------
else if (Lights == 2 && Pattern == 1 && pirValueG == 0 && pirValueD == 0)
{
fill_solid( &(garage[0]), NUM_LEDS, CRGB(RedV, GreenV, BlueV));
fill_solid( &(house[0]), NUM_LEDS, CRGB(RedV, GreenV, BlueV));
fill_solid( &(handrail[0]), NUM_LEDS, CRGB(RedV, GreenV, BlueV));
fill_solid( &(leds4[0]), NUM_LEDS, CRGB(RedV, GreenV, BlueV));
FastLED.show();
}
//---------------TURN ALL THE LIGHTS ON to TWINKLE using user slected color-------------------------
else if (Lights == 1 && Pattern == 2)
{
int a = random(NUM_LEDS);
if (a < NUM_LEDS) garage[a] = CRGB(RedV, GreenV, BlueV);
for (int b = 0; b < NUM_LEDS; b++) garage[b].fadeToBlackBy(4);
int c = random(NUM_LEDS2);
if (c < NUM_LEDS2) house[c] = CRGB(RedV, GreenV, BlueV);
for (int d = 0; d < NUM_LEDS2; d++) house[d].fadeToBlackBy(4);
int e = random(NUM_LEDS3);
if (e < NUM_LEDS3) handrail[e] = CRGB(RedV, GreenV, BlueV);
for (int f = 0; f < NUM_LEDS3; f++) handrail[f].fadeToBlackBy(4);
int g = random(NUM_LEDS4);
if (g < NUM_LEDS4) leds4[g] = CRGB(RedV, GreenV, BlueV);
for (int h = 0; h < NUM_LEDS4; h++) leds4[h].fadeToBlackBy(4);
FastLED.show();
FastLED.delay(200); // FastLED delay
}
//***************************************************************
//---------------TURN ALL THE LIGHTS ON SOLID to CHRISTMAS PATTERN (alternating red and green)-------------------------
else if (Lights == 1 && Pattern == 3)
{
for (int x = 0; x < NUM_LEDS; x++)
{
if (x % 2 == 0) //Makes the even lights Green
{
garage[x] = CRGB(0, 128, 0);
house[x] = CRGB(0, 128, 0);
handrail[x] = CRGB(0, 128, 0);
leds4[x] = CRGB(0, 128, 0);
}
else // Makes the odd lights Red
{
garage[x] = CRGB(200, 0, 0);
house[x] = CRGB(200, 0, 0);
handrail[x] = CRGB(200, 0, 0);
leds4[x] = CRGB(200, 0, 0);
FastLED.show();
}
}
}
//***************************************************************
//---------------TURN ALL THE LIGHTS ON to CHRISTMAS (red and green) TWINKLE-------------------------
else if (Lights == 1 && Pattern == 4)
{
int a = random(NUM_LEDS);
if (a % 2) {
garage[a] = CRGB(250, 0, 0);
}
else {
garage[a] = CRGB(0, 250, 0 );
}
for (int b = 0; b < NUM_LEDS; b++) garage[b].fadeToBlackBy(4);
int c = random(NUM_LEDS);
if (c % 2) {
house[c] = CRGB(250, 0, 0);
}
else {
house[c] = CRGB(0, 250, 0 );
}
for (int d = 0; d < NUM_LEDS; d++) house[d].fadeToBlackBy(4);
int e = random(NUM_LEDS);
if (e % 2) {
handrail[e] = CRGB(250, 0, 0);
}
else {
handrail[e] = CRGB(0, 250, 0 );
}
for (int f = 0; f < NUM_LEDS; f++) handrail[f].fadeToBlackBy(4);
int g = random(NUM_LEDS);
if (g % 2) {
leds4[g] = CRGB(250, 0, 0);
}
else {
leds4[g] = CRGB(0, 250, 0 );
}
for (int h = 0; h < NUM_LEDS; h++) leds4[h].fadeToBlackBy(4);
FastLED.show();
FastLED.delay(200); // FastLED delay
}
//***************************************************************
//---------------TURN ALL THE LIGHTS ON SOLID to HALLOWEEN (Purple and Orange)-------------------------
else if (Lights == 1 && Pattern == 5)
{
for (int x = 0; x < NUM_LEDS; x++)
{
if (x % 2 == 0) //Sets the even lights purple
{
garage[x] = CRGB(250, 0, 200);
house[x] = CRGB(250, 0, 200);
handrail[x] = CRGB(250, 0, 200);
leds4[x] = CRGB(250, 0, 200);
}
else //Sets the odd lights orange
{
garage[x] = CRGB(250, 50, 0);
house[x] = CRGB(250, 50, 0);
handrail[x] = CRGB(250, 50, 0);
leds4[x] = CRGB(250, 50, 0);
FastLED.show();
}
}
}
//***************************************************************
//---------------TURN ALL THE LIGHTS ON to MANUAL HALLOWEEN (purple, and orange) TWINKLE-------------------------
else if (Lights == 1 && Pattern == 6)
{
int a = random(NUM_LEDS);
if (a % 2) {
garage[a] = CRGB(250, 0, 200); //Purple
}
else {
garage[a] = CRGB(250, 50, 0 ); // Orange
}
for (int b = 0; b < NUM_LEDS; b++) garage[b].fadeToBlackBy(4);
int c = random(NUM_LEDS);
if (c % 2) {
house[c] = CRGB(250, 0, 200);
}
else {
house[c] = CRGB(250, 50, 0 );
}
for (int d = 0; d < NUM_LEDS; d++) house[d].fadeToBlackBy(4);
int e = random(NUM_LEDS);
if (e % 2) {
handrail[e] = CRGB(250, 0, 200);
}
else {
handrail[e] = CRGB(250, 50, 0 );
}
for (int f = 0; f < NUM_LEDS; f++) handrail[f].fadeToBlackBy(4);
int g = random(NUM_LEDS);
if (g % 2) {
leds4[g] = CRGB(250, 0, 200);
}
else {
leds4[g] = CRGB(250, 50, 0 );
}
for (int h = 0; h < NUM_LEDS; h++) leds4[h].fadeToBlackBy(4);
FastLED.show();
FastLED.delay(200); // FastLED delay
}
//***************************************************************
//---------------TURN ALL THE LIGHTS ON SOLID to Valentines PATTERN -------------------------
else if (Lights == 1 && Pattern == 7)
{
for (int x = 0; x < NUM_LEDS; x++)
{
if (x % 2 == 0) //Makes the even lights Pink
{
garage[x] = CRGB(247, 80, 80);
house[x] = CRGB(247, 80, 80);
handrail[x] = CRGB(247, 80, 80);
leds4[x] = CRGB(247, 80, 80);
}
else // Makes the odd lights Red
{
garage[x] = CRGB(200, 0, 0);
house[x] = CRGB(200, 0, 0);
handrail[x] = CRGB(200, 0, 0);
leds4[x] = CRGB(200, 0, 0);
FastLED.show();
}
}
}
//***************************************************************
//---------------TURN ALL THE LIGHTS ON to Valentines (red and pink) TWINKLE-------------------------
else if (Lights == 1 && Pattern == 8)
{
int a = random(NUM_LEDS);
if (a % 2) {
garage[a] = CRGB(250, 0, 0);
}
else {
garage[a] = CRGB(247, 80, 80);
}
for (int b = 0; b < NUM_LEDS; b++) garage[b].fadeToBlackBy(4);
int c = random(NUM_LEDS);
if (c % 2) {
house[c] = CRGB(250, 0, 0);
}
else {
house[c] = CRGB(247, 80, 80);
}
for (int d = 0; d < NUM_LEDS; d++) house[d].fadeToBlackBy(4);
int e = random(NUM_LEDS);
if (e % 2) {
handrail[e] = CRGB(250, 0, 0);
}
else {
handrail[e] = CRGB(247, 80, 80);
}
for (int f = 0; f < NUM_LEDS; f++) handrail[f].fadeToBlackBy(4);
int g = random(NUM_LEDS);
if (g % 2) {
leds4[g] = CRGB(250, 0, 0);
}
else {
leds4[g] = CRGB(247, 80, 80);
}
for (int h = 0; h < NUM_LEDS; h++) leds4[h].fadeToBlackBy(4);
FastLED.show();
FastLED.delay(200); // FastLED delay
}
//***************************************************************
//---------------TURN ALL THE LIGHTS ON SOLID to St Patricks PATTERN -------------------------
else if (Lights == 1 && Pattern == 9)
{
for (int x = 0; x < NUM_LEDS; x++)
{
if (x % 2 == 0) //Makes the even lights Green
{
garage[x] = CRGB(10, 255, 2);
house[x] = CRGB(10, 255, 2);
handrail[x] = CRGB(10, 255, 2);
leds4[x] = CRGB(10, 255, 2);
}
else // Makes the odd lights light Green
{
garage[x] = CRGB(100, 255, 100);
house[x] = CRGB(100, 255, 100);
handrail[x] = CRGB(100, 255, 100);
leds4[x] = CRGB(100, 255, 100);
FastLED.show();
}
}
}
//***************************************************************
//---------------TURN ALL THE LIGHTS ON to St Patricks (Light green and green) TWINKLE-------------------------
else if (Lights == 1 && Pattern == 10)
{
int a = random(NUM_LEDS);
if (a % 2) {
garage[a] = CRGB(10, 166, 2);
}
else {
garage[a] = CRGB(100, 255, 100);
}
for (int b = 0; b < NUM_LEDS; b++) garage[b].fadeToBlackBy(4);
int c = random(NUM_LEDS);
if (c % 2) {
house[c] = CRGB(10, 166, 2);
}
else {
house[c] = CRGB(100, 255, 100);
}
for (int d = 0; d < NUM_LEDS; d++) house[d].fadeToBlackBy(4);
int e = random(NUM_LEDS);
if (e % 2) {
handrail[e] = CRGB(10, 166, 2);
}
else {
handrail[e] = CRGB(100, 255, 100);
}
for (int f = 0; f < NUM_LEDS; f++) handrail[f].fadeToBlackBy(4);
int g = random(NUM_LEDS);
if (g % 2) {
leds4[g] = CRGB(10, 166, 2);
}
else {
leds4[g] = CRGB(100, 255, 100);
}
for (int h = 0; h < NUM_LEDS; h++) leds4[h].fadeToBlackBy(4);
FastLED.show();
FastLED.delay(200); // FastLED delay
}
//***************************************************************
//---------------TURN ALL THE LIGHTS ON SOLID to WATER PATTERN (alternating Blues)-------------------------
else if (Lights ==