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

NeoPixels LED Ring Random Color & M5StickC ESP32

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

FUPA768K36U3RSQ.LARGE.jpg
3_a46785e5-1f9e-460b-9796-cc9265ec3fea_1200x1200.jpg
Adafruit-1643-30091150-01.jpg
VisuinoAdvrtisementRaspberryPiRobot1.jpg
  • 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

2020-10-26_16-44-05.jpg
  • 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

F5ZAEMUK36U3RS2.LARGE.jpg
FBZIDQ4K36U3RS3.LARGE.jpg

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

2020-10-26_18-03-48.jpg
2020-10-26_18-04-07.jpg
2020-10-26_17-28-22.jpg
2020-10-26_18-07-01.jpg
  • 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

2020-10-26_18-10-06.jpg
stickc-randomcolor.png

  • 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

2020-10-26_18-13-04.jpg

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