Summary of LED Show using Arduino Esplora
This article demonstrates controlling an Arduino Esplora's RGB LED using its built-in joystick and linear potentiometer. The X-axis adjusts red brightness, the Y-axis controls green, and the potentiometer regulates blue intensity. Values are output via the Serial Monitor and visually displayed on the LED.
Parts used in the LED Show using Arduino Esplora:
- Arduino Esplora
This example shows you how to read the values from the joystick. The output will be displayed through the serial monitor and as a color on the RGB LED.
The joystick has two axes, X and Y. Each axis controls a color of the RGB LED: red with the X-axis, and green with the Y-axis. The brightness of the blue element will be controlled by the position of the linear potentiometer.
Circuit
Only your Arduino Esplora is needed for this example.
joystick and slider to control the color of the RGB led on the Esplora
Code
The RGB LED is comprised of three colors that represent the three primary colors: red, green, and blue. Each of these light’s brightness is individually controllable with functions in the Esplora library:
If you want to control all the colors with one instruction you can use the writeRGB() function.
Moving the joystick and changing the position of the linear potentiometer will generate different values. These values are used to produce two different outputs: one will appear by opening the serial monitor, and the other is displayed physically through the RGB led.
/* Esplora LED Show Makes the RGB LED bright and glow as the joystick or the slider are moved. Created on 22 november 2012 By Enrico Gueli <[email protected]> Modified 22 Dec 2012 by Tom Igoe */
Hardware Required
- Arduino Esplora
For more detail: LED Show using Arduino Esplora
- What axes does the joystick have?
The joystick has two axes, X and Y. - How is the red color controlled?
The X-axis of the joystick controls the red color of the RGB LED. - How is the green color controlled?
The Y-axis of the joystick controls the green color of the RGB LED. - What controls the blue element brightness?
The position of the linear potentiometer controls the brightness of the blue element. - Where can the output values be viewed?
The output will be displayed through the serial monitor and as a color on the RGB LED. - Which functions control individual colors?
The writeRed, writeGreen, and writeBlue functions individually control each light's brightness. - Is there a function to control all colors at once?
Yes, the writeRGB function allows controlling all colors with one instruction. - What happens when the slider is moved?
Moving the slider generates different values that produce outputs on the Serial Monitor and the RGB LED. - Can this project run without additional components?
Yes, only your Arduino Esplora is needed for this example.


