M5StickC ESP32 & NeoPixels LED Ring Random Color
by RonFrtek in Circuits > Arduino
1215 Views, 4 Favorites, 0 Comments
M5StickC ESP32 & NeoPixels LED Ring Random Color
In this project we will learn how to display a random color on the NeoPixels LED Ring using a M5StickC ESP32 board.
Watch the Video.
What You Will Need
- M5StickC ESP32
- NeoPixels LED Ring (In this project we use a LedRing with 12 LED Pixels but you can use any other if you want)
- Visuino software: Download Visuino here: https://www.visuino.eu
The Circuit
- Connect StickC pin 5V to LedRing pin VCC
- Connect StickC pin GND to LedRing pin GND
- Connect StickC pin G26 to LedRing pin DI
Start Visuino, and Select the M5 Stack Stick C Board Type
Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "M5 Stack Stick C" as shown on Picture 2
In Visuino Add & Set Components
- Add "NeoPixels" component
- Add "Random Color" component
- Double click on the "NeoPixels1"
In the properties window set the number of the led pixels on your LED Ring, in our case its 12. So set "Count Pixels" to 12 - Close the Pixel Groups window.
In Visuino Connect Components
- Connect "M5 Stack Stick C" Button pin M5 to "RandomColor1" pin clock
- Connect "RandomColor1" pin Out to "NeoPixels1" > Color1> pin color.
- Connect "NeoPixels1" pin Out to "M5 Stack Stick C" pin GPIO 26
Generate, Compile, and Upload the Code
In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.
Play
If you power the M5StickC module and click on the Orange button M5, the LED Ring will display a random color, then click the M5 button again to change the color.
Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it and open it in Visuino: https://www.visuino.eu