Example Code for Arduino - Light up the blink light

Last revision 2026/02/05

Hardware Preparation

ESP32-S3-Based DMX512 Smart Lighting Controller x 1

On the DMX512 controller, there is a blue LED onboard, internally connected to IO21 of the ESP32-S3. This LED is used for quickly verifying code and facilitating program debugging. As shown in the figure below:
BLINK-LED.png

Software Preparation

  1. Use a Type-C USB cable to connect the USB interface on the back of the controller to the computer.

  2. Open Arduino IDE.

  3. From the IDE menu, select: Tools > Board > ESP32S3 Dev Module.

  4. From the IDE menu, select: Tools > Port > The port corresponding to the development board (e.g., COM3 in the figure, the port number may vary on different computers).

test IDE-1
test IDE-2

Sample Code

Copy the following code to the editor:

#include "DFRobot_DMX512.h"

DFRobot_DMX512 dmx512; 

void setup() {
    Serial.begin(115200);  
    while(dmx512.begin() != 0){   //Initialize DMX512.
        Serial.println("init error");
        delay(1000);
    }
    Serial.println("init OK");
    pinMode(21, OUTPUT);//Set pin 21 as output mode.
}

void loop() {
    digitalWrite(21, HIGH); //Write high level to the port.
    delay(1000);            // Delay one second.
    digitalWrite(21, LOW);  //Write low level to the port.
    delay(1000);           //Delay one second.  
}

Compile and download the program to the controller.
result1

Result

After the program download is complete, you will see the blue LED on the controller blinking at a frequency of one second.

Was this article helpful?

TOP