#define BLUE 0
#define RED 17
#define GREEN 4
#define RED_B 34
#define GREEN_B 35
#define BLUE_B 32
#define YELLOW_B 33
#define ORANGE_B 25
#define turquoise_B 26
#define PURPLE_B 27
#define HEART 14
void setup() {
//Outputs :3
pinMode(BLUE, OUTPUT);
pinMode(RED, OUTPUT);
pinMode(GREEN, OUTPUT);
//Inputs :3
pinMode(RED_B, INPUT);
pinMode(GREEN_B, INPUT);
pinMode(BLUE_B, INPUT);
pinMode(YELLOW_B, INPUT);
pinMode(ORANGE_B, INPUT);
pinMode(turquoise_B, INPUT);
pinMode(PURPLE_B, INPUT);
pinMode(HEART, OUTPUT);
}
void loop() {
delay(10);
HEART_LOOP();
//Color_State
int RED_S = digitalRead(RED_B);
int GREEN_S = digitalRead(GREEN_B);
int BLUE_S = digitalRead(BLUE_B);
int YELLOW_S = digitalRead(YELLOW_B);
int ORANGE_S = digitalRead(ORANGE_B);
int turquoise_S = digitalRead(turquoise_B);
int PURPLE_S = digitalRead(PURPLE_B);
if (RED_S == LOW) {
RGB(255,0,0);
}
else if (GREEN_S == LOW) {
RGB(0,255,0);
}
else if (BLUE_S == LOW) {
RGB(0,0,255);
}
else if (YELLOW_S == LOW) {
RGB(255,255,0);
}
else if (ORANGE_S == LOW) {
RGB(255,165,0);
}
else if (turquoise_S == LOW) {
RGB(64,224,208);
}
else if (PURPLE_S == LOW) {
RGB(128,0,128);
}
else{
RGB(0,0,0);
}
}
void RGB(int redValue, int greenValue, int blueValue) {
analogWrite(RED, redValue);
analogWrite(GREEN, greenValue);
analogWrite(BLUE, blueValue);
}
void HEART_LOOP() {
digitalWrite(HEART, 1);
delay(50);
digitalWrite(HEART, 0);
delay(200);
digitalWrite(HEART, 1);
delay(50);
digitalWrite(HEART, 0);
delay(50);
digitalWrite(HEART, 1);
delay(50);
digitalWrite(HEART, 0);
delay(800);
}