Introduction: 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.
Step 1: 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
Step 2: 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
Step 3: 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
Step 4: 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.
Step 5: 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
Step 6: 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.
Step 7: 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