int redLedPin = 11;
int greenLedPin = 10;
int blueLedPin = 9;
int adcValue;
void setup() {
// put your setup code here, to run once:
pinMode(redLedPin, OUTPUT);
pinMode(greenLedPin, OUTPUT);
pinMode(blueLedPin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
adcValue = analogRead(A0); // convert A0 to digital
analogWrite(redLedPin, map(adcValue, 0, 1023, 0, 255)); // PWM duty cycle of red pin port
adcValue = analogRead(A1); // convert A1 to digital
analogWrite(greenLedPin, map(adcValue, 0, 1023, 0, 255)); // PWM duty cycle of green pin port
adcValue = analogRead(A2); // convert A2 to digital
analogWrite(blueLedPin, map(adcValue, 0, 1023, 0, 255)); // PWM duty cycle of blue pin port
}