![]() ![]() Setup RGB and potentiometer pins #define RGB_RED_PIN 11Īt first, as a best practice, we create a define for each pin we are going to use. Int mode = map(potentiometerValue, 0, 1023, 0, 6) Int potentiometerValue = analogRead(POTENTIOMETER_PIN) Void digitalWriteRGB(byte red, byte blue, byte green) We are going to use digitalWrite() – LED fully powered on/off, which means that we have a combination of 7 colors: You can see the RGB LED as a combination of 3 different LEDs that you control separately. ![]() In this first application, we are going to modify the color of the RGB LED when we turn the potentiometer knob.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |