/*
  RGB com a Franzininho DIY
  Visit https://wokwi.com to learn about the Wokwi Simulator
  Visit https://franzininho.com.br to learn about the Franzininho
*/

#define RED_PIN   4
#define GREEN_PIN 1
#define BLUE_PIN  0

void setup() {
  pinMode(RED_PIN, OUTPUT);
  pinMode(GREEN_PIN, OUTPUT);
  pinMode(BLUE_PIN, OUTPUT);
}

void loop() {
  colorRGB(0, 0, 0);        // Off
  delay(1000);
  colorRGB(255, 8, 8);      // Red
  delay(1000);
  colorRGB(0, 255, 16);     // Green
  delay(1000);
  colorRGB(0, 0, 150);      // Blue
  delay(1000);
  colorRGB(255, 0, 12);     // Raspberry
  delay(1000);
  colorRGB(0, 255, 255);    // Cyan
  delay(1000);
  colorRGB(255, 255, 0);    // Yellow
  delay(1000);
  colorRGB(255, 255, 255);  // White
  delay(1000);
}

void colorRGB(uint8_t red, uint8_t green, uint8_t blue) {
  analogWrite(RED_PIN, red);
  analogWrite(GREEN_PIN, green);
  analogWrite(BLUE_PIN, blue);
}