# ESP8266 wled with 24 bit LED ring help

**URL:** <https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649>\
**Category:** Questions\
**Created:** [April 19, 2024, 7:44am UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649 "2024-04-19T07:44:38Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr\_chef1](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/mr_chef1/32/9837_2.png) [@mr\_chef1](https://wled.discourse.group/u/mr_chef1)\
**Post date:** [April 19, 2024, 7:44am UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/1 "2024-04-19T07:44:38Z")

</div>

Hi, I’m working on a project using an ESP8266 with wled installed on it, I’m using an led ring with 24 leds on it and have been having fun messing around with them but now I have a project I need it for. I’m basically making a bike back light as I don’t have one and I thought it would be fun to make my own with some unique features like turn signals a brake light. I need a way to change the flashing red light to solid red when I hit the brakes on my bike and need like some kind of button for turn signals on the handle bars, I’m a bit lost though as to how to do that, with the code and the hardwear side of things and was hoping someone could help.

---

<div class="post-metadata">

**Author:** ![divsys](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@divsys](https://wled.discourse.group/u/divsys)\
**Post date:** [April 19, 2024, 3:27pm UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/2 "2024-04-19T15:27:24Z")

</div>

There have been a few threads talking about turn-signal setups.

A quick search turned up: [Turn-Signal implementation](https://wled.discourse.group/t/turn-signals-multiple-switch-inputs-solved/3302/7)

That may give you some ideas.

---

<div class="post-metadata">

**Author:** ![Magig\_Wled](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@Magig\_Wled](https://wled.discourse.group/u/Magig_Wled)\
**Post date:** [April 19, 2024, 4:47pm UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/3 "2024-04-19T16:47:16Z")

</div>

@mr_chef1 You know that the police will fine you if you got somthing like this  
Backlight is sopost to be red in some way blinking for less power consuntion  
the rest like a light show can cost you in some countrys the CAR license and a very large fine  
if you are on public roads

BESIDE try using offset and grouping spacing  
like in the WLED Wiki  
[https://kno.wled.ge/features/segments/](https://kno.wled.ge/features/segments/)

---

<div class="post-metadata">

**Author:** ![mr\_chef1](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/mr_chef1/32/9837_2.png) [@mr\_chef1](https://wled.discourse.group/u/mr_chef1)\
**Post date:** [April 19, 2024, 9:49pm UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/4 "2024-04-19T21:49:59Z")

</div>

I’m not trying to have a light show on the back of my bike, I’ve just had some problems with biking with friends and nobody knowing when someone is braking. thought it would be nice to signal that I’m braking with the bike light. the turn signals I thought would just be nice to have, don’t really need them though it would just help with letting my friends know were we are going to be going and when to turn.

---

<div class="post-metadata">

**Author:** ![Magig\_Wled](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@Magig\_Wled](https://wled.discourse.group/u/Magig_Wled)\
**Post date:** [April 20, 2024, 6:27am UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/5 "2024-04-20T06:27:44Z")

</div>

you cout do a simple arduino projekt on a nano with speedsensor levelsensor and FASTLED or ADAFRUIT\_pixel this makes it “AUTO” without doing anything just on level sensor and speedsensor

the projekt can be runned entirerly on a 9V Block ir S2 Lipo as the led currnent meeds the Nano limit

---

<div class="post-metadata">

**Author:** ![mr\_chef1](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/mr_chef1/32/9837_2.png) [@mr\_chef1](https://wled.discourse.group/u/mr_chef1)\
**Post date:** [April 20, 2024, 7:16am UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/6 "2024-04-20T07:16:30Z")

</div>

well, I don’t have any of that stuff but I was just thinking earlier today if I could just code it on arduino and you can upload arduino code to an ESP board which will give me the obillity to control it from my phone if I ever need/want to, but I don’t know how to split the led ring into segments on arduino to control each part of the led ring separately, do you know how I could do this?  
and thank you for the help btw

---

<div class="post-metadata">

**Author:** ![Magig\_Wled](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@Magig\_Wled](https://wled.discourse.group/u/Magig_Wled)\
**Post date:** [April 20, 2024, 10:25am UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/7 "2024-04-20T10:25:17Z")

</div>

@mr_chef1 use EASY ESP it has all you need in setup  
sorry i forgot there is a advance that integreted this Modul already into WLED  
look here for more infos

> <https://github.com/Aircoookie/WLED/issues/1211>
>
> Good day. I implemented zonal lighting in the kitchen. You can view it here http…s://youtu.be/XQdQc8rYKdA and here https://youtu.be/cMkz4YwIMG4. I use two controllers, one with Aircoookie WLED firmware and the second with EspEasy firmware for the HC-SR04 ultrasonic sensor. The Aircoookie WLED firmware has a usermod folder and I wanted to add the HC-SR04 ultrasonic sensor to it. I'm not good at code and I would like to have a ready-made plugin in the usermod folder so that I can get values from the rangefinder in the Aircoookie WLED firmware itself and configure which segments to use in it. Please add the HC-SR04 ultrasonic sensor to usermod and make it appear in the interface.

---

<div class="post-metadata">

**Author:** ![mr\_chef1](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/mr_chef1/32/9837_2.png) [@mr\_chef1](https://wled.discourse.group/u/mr_chef1)\
**Post date:** [April 20, 2024, 11:23pm UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/8 "2024-04-20T23:23:43Z")

</div>

do you know how to make segments on arduino for led strips/ring, my led ring has 24 leds and I want to use top half for the brake lights and flashing when I’m not braking and the and the bottom half for the turn signals, the setup would t10 flashing red unless braking, ten solid red when braking, 5 flashing orange/yellow when turning left, and another 5 flashing orange/yellow when turning right with 2 leds on either side to seperate the braking light from the turn signals.

---

<div class="post-metadata">

**Author:** ![Magig\_Wled](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@Magig\_Wled](https://wled.discourse.group/u/Magig_Wled)\
**Post date:** [April 21, 2024, 7:18am UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/9 "2024-04-21T07:18:58Z")

</div>

this very simple Progeamming

here is a small Example [WS2812b fastled - General Electronics - Arduino Forum](https://forum.arduino.cc/t/ws2812b-fastled/1074950)

You do not need segments in ARDUINO its the main loop() calls the subprogramm in sensor or whatever behavior like if levelsens \< 100{left()}  
this then sets the LED’s  
like

```auto
void left() {
for(int i=8; i< 12; i++){
     leds[i].setRGB(255, 0, 0);
     FastLED.show(); 
   }
}

```

void right() …

so all is in main loop

---

<div class="post-metadata">

**Author:** ![mr\_chef1](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/mr_chef1/32/9837_2.png) [@mr\_chef1](https://wled.discourse.group/u/mr_chef1)\
**Post date:** [April 21, 2024, 7:26am UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/10 "2024-04-21T07:26:48Z")

</div>

that looks very promising, thank you, this is how I was coding it before

#include \<FastLED.h\>

#define LED\_PIN 9  
#define NUM\_LEDS 24

CRGB leds[NUM\_LEDS];

void setup() {  
FastLED.addLeds\<WS2812, LED\_PIN, GRB\>(leds, NUM\_LEDS);

//step 1  
leds[0] = CRGB(0,0,255);  
FastLED.show();  
leds[23] = CRGB(0,0,255);  
FastLED.show();  
leds[11] = CRGB(0,0,255);  
FastLED.show();  
leds[12] = CRGB(0,0,255);  
FastLED.show();  
delay(50);

//step 2  
leds[1] = CRGB(255,0,0);  
FastLED.show();  
leds[22] = CRGB(255,55,0);  
FastLED.show();  
leds[10] = CRGB(255,0,0);  
FastLED.show();  
leds[13] = CRGB(255,55,0);  
FastLED.show();  
delay(50);

//step 3  
leds[2] = CRGB(255,0,0);  
FastLED.show();  
leds[21] = CRGB(255,55,0);  
FastLED.show();  
leds[9] = CRGB(255,0,0);  
FastLED.show();  
leds[14] = CRGB(255,55,0);  
FastLED.show();  
delay(50);

//step 4  
leds[3] = CRGB(255,0,0);  
FastLED.show();  
leds[20] = CRGB(255,55,0);  
FastLED.show();  
leds[8] = CRGB(255,0,0);  
FastLED.show();  
leds[15] = CRGB(255,55,0);  
FastLED.show();  
delay(50);

//step 5  
leds[4] = CRGB(255,0,0);  
FastLED.show();  
leds[19] = CRGB(255,55,0);  
FastLED.show();  
leds[7] = CRGB(255,0,0);  
FastLED.show();  
leds[16] = CRGB(255,55,0);  
FastLED.show();  
delay(50);

//step 6  
leds[5] = CRGB(255,0,0);  
FastLED.show();  
leds[18] = CRGB(255,55,0);  
FastLED.show();  
leds[6] = CRGB(255,0,0);  
FastLED.show();  
leds[17] = CRGB(255,55,0);  
FastLED.show();  
delay(50);  
}

void loop() {  
if () {  
leds[0] = CRGB(0,0,255);  
FastLED.show();  
leds[1] = CRGB(255,0,0);  
FastLED.show();  
leds[2] = CRGB(255,0,0);  
FastLED.show();  
leds[3] = CRGB(255,0,0);  
FastLED.show();  
leds[4] = CRGB(255,0,0);  
FastLED.show();  
leds[5] = CRGB(255,0,0);  
FastLED.show();  
leds[6] = CRGB(255,0,0);  
FastLED.show();  
leds[7] = CRGB(255,0,0);  
FastLED.show();  
leds[8] = CRGB(255,0,0);  
FastLED.show();  
leds[9] = CRGB(255,0,0);  
FastLED.show();  
leds[10] = CRGB(255,0,0);  
FastLED.show();  
leds[11] = CRGB(0,0,255);  
FastLED.show();  
leds[12] = CRGB(0,0,255);  
FastLED.show();  
leds[13] = CRGB(255,55,0);  
FastLED.show();  
leds[14] = CRGB(255,55,0);  
FastLED.show();  
leds[15] = CRGB(255,55,0);  
FastLED.show();  
leds[16] = CRGB(255,55,0);  
FastLED.show();  
leds[17] = CRGB(255,55,0);  
FastLED.show();  
leds[18] = CRGB(255,55,0);  
FastLED.show();  
leds[19] = CRGB(255,55,0);  
FastLED.show();  
leds[20] = CRGB(255,55,0);  
FastLED.show();  
leds[21] = CRGB(255,55,0);  
FastLED.show();  
leds[22] = CRGB(255,55,0);  
FastLED.show();  
leds[23] = CRGB(0,0,255);  
FastLED.show();  
delay(500);  
}else if () {

}else if () {

}else if () {

}  
}  
just so I could get somewhere, took the code from a previous project… still coding it though but I think I’ll try your way and save mine as a last resort.

---

<div class="post-metadata">

**Author:** ![mr\_chef1](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/mr_chef1/32/9837_2.png) [@mr\_chef1](https://wled.discourse.group/u/mr_chef1)\
**Post date:** [April 21, 2024, 7:28am UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/11 "2024-04-21T07:28:49Z")

</div>

btw, how would I do that with 2 buttons for left and right and a flip switch for brakes (I’m guessing I could just use the same code from the buttons for the switch)

---

<div class="post-metadata">

**Author:** ![Magig\_Wled](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@Magig\_Wled](https://wled.discourse.group/u/Magig_Wled)\
**Post date:** [April 21, 2024, 8:33am UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/12 "2024-04-21T08:33:38Z")

</div>

ok so you can do it  
You can make this a quite cool thing using your smartphone sensors  
VIA a HC-05 to your Arduino  
If you are like a Semi pro you can do a APP that graps the Speed and level sensor of yopur phone and send it to the Arduino that acts on this sensors  
The app shoudt also got the responding buttons for manuell override  
and you can go MAD by color and effects  
this will shure generate some Downloads

---

<div class="post-metadata">

**Author:** ![mr\_chef1](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/mr_chef1/32/9837_2.png) [@mr\_chef1](https://wled.discourse.group/u/mr_chef1)\
**Post date:** [April 21, 2024, 8:38am UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/13 "2024-04-21T08:38:53Z")

</div>

so what I have (and will probably be using) is a LOT of arduino boards (specificly arduino uno r3), an ESP32 DEVKIT V1, an ESP8266, two buttons (I’ll probably just use one), a flip switch, a 24 bit led ring, and a LOT of wires, oh and like 6 different ways to power it.

---

<div class="post-metadata">

**Author:** ![mr\_chef1](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/mr_chef1/32/9837_2.png) [@mr\_chef1](https://wled.discourse.group/u/mr_chef1)\
**Post date:** [April 21, 2024, 8:39am UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/14 "2024-04-21T08:39:36Z")

</div>

oh yeah, and I know how to solder and have the stuff for that

---

<div class="post-metadata">

**Author:** ![mr\_chef1](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/mr_chef1/32/9837_2.png) [@mr\_chef1](https://wled.discourse.group/u/mr_chef1)\
**Post date:** [April 21, 2024, 8:51am UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/15 "2024-04-21T08:51:28Z")

</div>

ok, I think I might be doing something wrong, I’m kinda new to custom voids…

#include \<Adafruit\_NeoPixel.h\>  
#define PIN 9 // input pin Neopixel is attached to  
#define NUMPIXELS 24 // number of neopixels in strip  
Adafruit\_NeoPixel pixels = Adafruit\_NeoPixel(NUMPIXELS, PIN, NEO\_GRB + NEO\_KHZ800);

const int colorAmount = 3;  
const int button = 8;  
const int Switch = 8;  
int colors[colorAmount][3] = {{255,0,0},{255,255,0},{0,0,255}};  
int addVal = 0; //no change  
int delayVal = 50;  
int Mode = 1;

void setup() {  
pixels.begin();  
pinMode(9, OUTPUT);  
}

void loop() {  
void StandBy() {  
for (int i=0; i\<1; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=1; i\<11; i++) {int index = i+addVal; int r = 255; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=11; i\<13; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=13; i\<18; i++) {int index = i+addVal; int r = 255; int g = 55; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=18; i\<23; i++) {int index = i+addVal; int r = 255; int g = 55; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=23; i\<24; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
pixels.show();  
addVal++;  
delay(delayVal);  
}

void Brakes() {

}

void Right() {

}

void Left() {

}

if (button == HIGH && Mode == 1) {  
voidStandBy()  
}else if(button == HIGH && Mode == 2) {  
voidBrakes()  
}else if(button == HIGH && Mode==3 && Switch == HIGH) {  
voidRight()  
}else if(button == HIGH && Mode == 3 && Switch == LOW) {  
voidLeft()  
}  
}

---

<div class="post-metadata">

**Author:** ![mr\_chef1](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/mr_chef1/32/9837_2.png) [@mr\_chef1](https://wled.discourse.group/u/mr_chef1)\
**Post date:** [April 21, 2024, 10:15am UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/16 "2024-04-21T10:15:11Z")

</div>

Changed the code a bit but the buttons and switch aren’t working

#include \<Adafruit\_NeoPixel.h\>  
#define PIN 9 // input pin Neopixel is attached to  
#define NUMPIXELS 24 // number of neopixels in strip  
Adafruit\_NeoPixel pixels = Adafruit\_NeoPixel(NUMPIXELS, PIN, NEO\_GRB + NEO\_KHZ800);

const int colorAmount = 3;  
const int button1 = 10;  
const int button2 = 11;  
const int Switch = 8;  
int buttonState1 = 0;  
int buttonState2 = 0;  
int switchState = 0;  
int colors[colorAmount][3] = {{255,0,0},{255,255,0},{0,0,255}};  
int addVal = 0; //no change  
int delayVal = 250;  
int Mode = 1;  
int PressDelay = 25;

void setup() {  
Serial.begin(9600);  
pixels.begin();  
pinMode(9, OUTPUT);  
pinMode(button1, INPUT);  
pinMode(button2, INPUT);  
pinMode(Switch, INPUT);  
}

void loop() {  
buttonState1 = digitalRead(button1);  
buttonState2 = digitalRead(button2);  
switchState = digitalRead(Switch);

if (button1 == HIGH) {  
delay(PressDelay);  
Serial.println("button pressed: ");  
if (Mode\<3) {  
Mode++;  
}else if(Mode\>=3) {  
Mode = 1;  
}  
}else if(button2 == HIGH) {  
delay(PressDelay);  
if (Mode == 2) {  
Mode++;  
}else if(Mode == 1) {  
Mode = 3;  
}else if(Mode == 3) {  
Mode = 1;  
}  
}  
Serial.print(Mode);  
if (Mode == 1) {  
for (int i=0; i\<1; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=1; i\<11; i++) {int index = i+addVal; int r = 255; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=11; i\<13; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=13; i\<18; i++) {int index = i+addVal; int r = 0; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=18; i\<23; i++) {int index = i+addVal; int r = 0; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=23; i\<24; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
pixels.show();  
addVal++;  
delay(delayVal);  
for (int i=0; i\<1; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=1; i\<11; i++) {int index = i+addVal; int r = 0; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=11; i\<13; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=13; i\<18; i++) {int index = i+addVal; int r = 0; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=18; i\<23; i++) {int index = i+addVal; int r = 0; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=23; i\<24; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
pixels.show();  
addVal++;  
delay(delayVal);  
}else if(Mode == 2) {  
for (int i=0; i\<1; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=1; i\<11; i++) {int index = i+addVal; int r = 255; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=11; i\<13; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=13; i\<18; i++) {int index = i+addVal; int r = 0; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=18; i\<23; i++) {int index = i+addVal; int r = 0; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=23; i\<24; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
pixels.show();  
addVal++;  
}else if(Mode == 3 && Switch == HIGH) {  
for (int i=0; i\<1; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=1; i\<11; i++) {int index = i+addVal; int r = 255; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=11; i\<13; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=13; i\<18; i++) {int index = i+addVal; int r = 255; int g = 55; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=18; i\<23; i++) {int index = i+addVal; int r = 0; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=23; i\<24; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
pixels.show();  
addVal++;  
delay(delayVal);  
for (int i=0; i\<1; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=1; i\<11; i++) {int index = i+addVal; int r = 0; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=11; i\<13; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=13; i\<18; i++) {int index = i+addVal; int r = 0; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=18; i\<23; i++) {int index = i+addVal; int r = 0; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=23; i\<24; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
pixels.show();  
addVal++;  
delay(delayVal);  
}else if(Mode == 3 && Switch == LOW) {  
for (int i=0; i\<1; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=1; i\<11; i++) {int index = i+addVal; int r = 255; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=11; i\<13; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=13; i\<18; i++) {int index = i+addVal; int r = 0; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=18; i\<23; i++) {int index = i+addVal; int r = 255; int g = 55; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=23; i\<24; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
pixels.show();  
addVal++;  
delay(delayVal);  
for (int i=0; i\<1; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=1; i\<11; i++) {int index = i+addVal; int r = 0; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=11; i\<13; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=13; i\<18; i++) {int index = i+addVal; int r = 0; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=18; i\<23; i++) {int index = i+addVal; int r = 0; int g = 0; int b = 0; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
for (int i=23; i\<24; i++) {int index = i+addVal; int r = 25; int g = 0; int b = 25; pixels.setPixelColor(i, pixels.Color(r,g,b));}  
pixels.show();  
addVal++;  
delay(delayVal);  
}  
}

if you could help that would be very much appreciated  
also if you could help make it a little more compact to run faster that would also be great, thank you

---

<div class="post-metadata">

**Author:** ![Magig\_Wled](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@Magig\_Wled](https://wled.discourse.group/u/Magig_Wled)\
**Post date:** [April 21, 2024, 2:54pm UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/17 "2024-04-21T14:54:04Z")

</div>

@mr_chef1 TRY this **ARATION the LED Ring is on PIN4**  
in IARDUINO DE Monitor Tyoe L for Left blink R… or S blink Stop B for break

```auto
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
 #include <avr/power.h> 
#endif

// Which pin on the Arduino is connected to the NeoPixels?
#define PIN 4 

// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 24

Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

int incomingByte = 0; // for incoming serial data
boolean blink = 0;
boolean ison = 0;
int blinkcount = 4; // 4 times 1sec
// segments
int leftpixels[7]={0,1,2,3,4,5,6};
int toppixels[6]={7,8,9,10,11,12};
int rightpixels[6]={13,14,15,16,17,18};
int downpixels[6]={19,20,21,22,23,24};
int level=0;
//color
uint32_t red = pixels.Color(255, 0,0);
long previousMillis; // will store last time pixel was updated
unsigned long currentMillis; 
const long interval = 1000; // Länge der Pause in ms

void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
 pixels.begin(); // INITIALIZE NeoPixel pixels object (REQUIRED)
 pixels.setBrightness(25);
}

void loop() 
{

  currentMillis = millis();
  //wait Blink
  if (currentMillis - previousMillis >= interval) { 
     previousMillis = currentMillis; // Zeitpunkt der letzten Schaltung wird festgehalten 
     if (!ison && blink){
      pixels.clear();
      pixels.show();}
     else{
      //Serial.print("on \n ");
      switch(level){
      case 1 : {left();
      break;}
       case 5 : {stop(true);
      break;}
     }
     }
ison=!ison;     
  }

  if (Serial.available() > 0) {
    // read the incoming byte:
    incomingByte = Serial.read();

    // say what you got:
    Serial.print("I received: ");
    Serial.println(incomingByte);
  }
  
  switch (incomingByte)
     {
      case 76 : {left(); // 'L'
      break;}
      case 82 : {right(); //'R'
      ;break;}
      case 83 : {stop(true); // 'S'
      ;break;}
      case 66 : {stop(false); // 'B'
      ;break;}

     default : pixels.clear(); // Set all pixel colors to 'off'
}

}

void left(){
  level=1;
  pixels.clear(); // Set all pixel colors to 'off'
  for (int i=0;i<sizeof(leftpixels)/sizeof(int);i++){
    pixels.setPixelColor(leftpixels[i],pixels.Color(209,134,0)); 

  }
  blink=true;
    pixels.show();
}

void right(){
  pixels.clear(); // Set all pixel colors to 'off'
  for (int i=0;i<sizeof(rightpixels)/sizeof(int);i++){
    pixels.setPixelColor(rightpixels[i], pixels.Color(209,134,0));  
  }
  pixels.show();
}

void stop(boolean doblink){
  if (doblink)level=5;
  else level = 0;
  blink=doblink;
  pixels.fill(red,0,24); // 
  pixels.show();
  
}

```

---

<div class="post-metadata">

**Author:** ![mr\_chef1](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/mr_chef1/32/9837_2.png) [@mr\_chef1](https://wled.discourse.group/u/mr_chef1)\
**Post date:** [April 21, 2024, 8:50pm UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/18 "2024-04-21T20:50:13Z")

</div>

I always seem to have problems with AVR code

 ![image](https://global.discourse-cdn.com/free1/uploads/wled/original/2X/5/5e94bcfdf885d71bfc30253daa9121a93732d491.png)

---

<div class="post-metadata">

**Author:** ![kilrah](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/kilrah/32/5927_2.png) [@kilrah](https://wled.discourse.group/u/kilrah)\
**Post date:** [April 21, 2024, 9:01pm UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/19 "2024-04-21T21:01:19Z")

</div>

1. Don’t use the MS store version of the arduino IDE
2. You should be using Arduino IDE 2, way better nowadays

---

<div class="post-metadata">

**Author:** ![mr\_chef1](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/mr_chef1/32/9837_2.png) [@mr\_chef1](https://wled.discourse.group/u/mr_chef1)\
**Post date:** [April 21, 2024, 9:11pm UTC](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649/20 "2024-04-21T21:11:42Z")

</div>

was there an update for arduino ide?

[Next page](https://wled.discourse.group/t/esp8266-wled-with-24-bit-led-ring-help/11649.md?page=2)
