Project 3.03 Potentiometer sets LED Brightness
Now that we’re able to read the value of the thumbwheel potentiometer, we can use it to control any of the outputs on the Arno. In this project, we use it to set the brightness of the red channel of the RGB LED.
Concepts: ADC, analogRead, analogWrite
Circuits:
Concepts: ADC, analogRead, analogWrite
Circuits:
Instead of using a function like map, we simply divide the value of the potentiometer by 4 so that it fits within the range used by analogWrite:
analogWrite(redLED,potRead/4);
analogWrite(redLED,potRead/4);