
// Define the pins for the LED strip
#define RED 25
#define GREEN 33
#define BLUE 32

// Relay pin
#define RELAY 26

bool isOn = false;

void setup() {
  // Set the pins as outputs
  pinMode(RED, OUTPUT);
  pinMode(GREEN, OUTPUT);
  pinMode(BLUE, OUTPUT);
  pinMode(RELAY, OUTPUT);
  Serial.begin(9600);
}

// Print current values of the pins
void printValues() {
  Serial.println("Red: " + String(analogRead(RED)));
  Serial.println("Green: " + String(analogRead(GREEN)));
  Serial.println("Blue: " + String(analogRead(BLUE)));
}

// Function that sets the color of the LED strip
void setColor(int red, int green, int blue) {
  
  // Set the color of the LED strip
  analogWrite(RED, red);
  analogWrite(GREEN, green);
  analogWrite(BLUE, blue);
  printValues();
  return;
}


// Function that toggles the RELAY
void toggle() {
  if (isOn) {
    digitalWrite(RELAY, LOW);
    isOn = false;
  } else {
    digitalWrite(RELAY, HIGH);
    isOn = true;
  }
}



void loop() {
  // Alternate between off and white over 5 seconds
  toggle();
  delay(5000);
  setColor(255, 255, 255);
  delay(5000);
}
 