Example Code for Arduino-Dazzling Neon Light

Last revision 2025/12/09

The colors of the 24 lamp beads are displayed in gradients and change by levels successively around the circle every 0.1s to form a rotating effect as if it’s a dynamic rainbow.

Hardware Preparation

  • RGB LED ring- 24 LED beads × 1
  • Arduino uno × 1
  • IO Expansion Board × 1

Software Preparation

(1) Import the library file of RGB LED into Arduino library first, find the installation location of Arduino, and put the file of RGB LED ring into the libraries of Arduino.

DFRobot_NeoPixel.zip

(2) Before using the RGB LED ring, enter Arduino and click "Toolbar- Development Board" (as shown in the picture)

Wiring Diagram

Other Preparation Work

(1) Import the library file of RGB LED into Arduino library first, find the installation location of Arduino, and put the file of RGB LED ring into the libraries of Arduino.

(2) Before using the RGB LED ring, enter Arduino and click "Toolbar- Development Board" (as shown in the picture)

Sample Code

/*!
 * @file        RGB ring.ino
 * @brief       The colors of the 24 lamp beads are displayed in gradients and change by levels successively around the circle to form a rotating effect as if it's a dynamic rainbow.
 * @copyright   Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
 * @licence     The MIT License (MIT)
 * @author      [qsjhyy]([email protected])
 * @version     V0.1
 * @date        2021-09-24
 * @get from    https://www.dfrobot.com
 * @url         
 */
#include <DFRobot_NeoPixel.h>
// Create a object
DFRobot_NeoPixel neoPixel_2;


// Main program start
void setup() {
  neoPixel_2.begin(2, 24);
  neoPixel_2.showRainbow(0, 24, 1, 360);
}
void loop() {
  delay(10);
  neoPixel_2.rotate(1);
}

Result

The colors of the 24 lamp beads are displayed in gradients and change by levels successively around the circle every 0.1s to form a rotating effect as if it’s a dynamic rainbow.

Was this article helpful?

TOP