Answered step by step
Verified Expert Solution
Question
1 Approved Answer
int LED_Red = 13; int LED_Green = 12; int LED_Blue = 11; int Pin_LED_Red = 3; int Pin_LED_Blue = 5; int Pin_LED_Green = 6; int
int LED_Red = 13;
int LED_Green = 12;
int LED_Blue = 11;
int Pin_LED_Red = 3;
int Pin_LED_Blue = 5;
int Pin_LED_Green = 6;
int potPin1 = A0;
int potPin2 = A1;
int potPin3 = A2;
void setup() {
pinMode(LED_Red, OUTPUT);
pinMode(LED_Blue, OUTPUT);
pinMode(LED_Green, OUTPUT);
pinMode(Pin_LED_Red, OUTPUT);
pinMode(Pin_LED_Blue, OUTPUT);
pinMode(Pin_LED_Green, OUTPUT);
pinMode(potPin1, INPUT);
pinMode(potPin2, INPUT);
pinMode(potPin3, INPUT);
Serial.begin(9600);
}
void loop() {
int Input_Color1 = analogRead(potPin1);
int Input_Color2 = analogRead(potPin2);
int Input_Color3 = analogRead(potPin3);
Input_Color1 = map(Input_Color1, 0, 1023, 0, 255);
Input_Color2 = map(Input_Color2, 0, 1023, 0, 255);
Input_Color3 = map(Input_Color3, 0, 1023, 0, 255);
analogWrite(Pin_LED_Red, Input_Color1);
analogWrite(Pin_LED_Blue, Input_Color2);
analogWrite(Pin_LED_Green, Input_Color3);
analogWrite(LED_Red, Input_Color1);
analogWrite(LED_Blue, Input_Color2);
analogWrite(LED_Green, Input_Color3);
serialRed();
serialBlue();
serialGreen();
}
void serialRed (){
int Value_Red = analogRead(A0);
Serial.println(Value_Red);
delay(200);
}
void serialBlue () {
int Value_Blue = analogRead(A1);
Serial.println(Value_Blue);
delay(200);
}
void serialGreen (){
int Value_Green = analogRead(A2);
Serial.println(Value_Green);
delay(200);
}
Whats the flow chart of this?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started