๐โโ๏ธ ESP32 Custom Group Size LED Chaser
Generate ESP32 code for an 8-LED chaser with selectable group size (1-4 LEDs) and variable speed.
✓ ESP32 (.ino)
✓ Live code preview
✓ Free download
Create a fully customizable LED chaser on ESP32. Choose how many LEDs light up together (1 to 4) and control the animation speed for endless pattern variations.
Uses sequential group chasing forward and reverse. Great for learning dynamic GPIO control and animation on ESP32.
โ๏ธ
Customise & Download
Adjust settings below โ the code updates live in real time
Live preview
Configure your ESP32 Custom LED Chaser
โ Your settings are reflected in the code below
Generated code โ live preview
/*
==========================================================
ESP32 Custom LED Chaser
Generated by techlogics.net
https://techlogics.net/electronics/esp32-custom-led-chaser.php
==========================================================
CAUTION: Review this code fully before uploading to any
hardware. Verify all pin connections and power requirements
match YOUR specific components. We are not responsible for
damage to hardware, fire, or injury resulting from incorrect
wiring, faulty components, or misuse of this code.
Generated on: 09 Jul 2026
==========================================================
*/
/*
ESP32 Custom LED Chaser โ generated by techlogics.net
Hardware: ESP32 + 8 LEDs with resistors
*/
// User configurable
const int CHASE_DELAY_MS = 300;
const int GROUP_SIZE = 2;
// Common ESP32 GPIO pins
const int ledPins[8] = {2, 4, 5, 18, 19, 21, 22, 23};
void setup() {
for (int i = 0; i < 8; i++) {
pinMode(ledPins[i], OUTPUT);
}
Serial.begin(115200);
Serial.println("ESP32 Custom Group LED Chaser Ready");
}
void loop() {
int numGroups = 8 / GROUP_SIZE;
// Forward chase
for (int g = 0; g < numGroups; g++) {
for (int i = 0; i < 8; i++) digitalWrite(ledPins[i], LOW);
int start = g * GROUP_SIZE;
for (int j = 0; j < GROUP_SIZE && start + j < 8; j++) {
digitalWrite(ledPins[start + j], HIGH);
}
delay(CHASE_DELAY_MS);
}
// Reverse chase
for (int g = numGroups - 2; g >= 0; g--) {
for (int i = 0; i < 8; i++) digitalWrite(ledPins[i], LOW);
int start = g * GROUP_SIZE;
for (int j = 0; j < GROUP_SIZE && start + j < 8; j++) {
digitalWrite(ledPins[start + j], HIGH);
}
delay(CHASE_DELAY_MS);
}
}
/*
==========================================================
End of generated code โ techlogics.net
Found this useful? Visit https://techlogics.net/electronics/esp32-custom-led-chaser.php
for more free CCTV, networking, electronics & finance tools.
Questions or issues? https://techlogics.net/contact.php
==========================================================
*/
How to use
1. Connect 8 LEDs with resistors to GPIO 2,4,5,18,19,21,22,23.
2. Select group size (1/2/3/4 LEDs per step) and chase speed.
3. Generate and upload the code to your ESP32.
4. Enjoy customizable chasing patterns based on your settings.
You might also like