# Same code runs different on two different picos

**URL:** <https://forums.pimoroni.com/t/same-code-runs-different-on-two-different-picos/24475>\
**Category:** Support\
**Created:** [March 18, 2024, 6:58pm UTC](https://forums.pimoroni.com/t/same-code-runs-different-on-two-different-picos/24475 "2024-03-18T18:58:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joshy-J](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/joshy-j/32/8184_2.png) [@Joshy-J](https://forums.pimoroni.com/u/Joshy-J)\
**Post date:** [March 18, 2024, 6:58pm UTC](https://forums.pimoroni.com/t/same-code-runs-different-on-two-different-picos/24475/1 "2024-03-18T18:58:24Z")

</div>

```auto
import machine
import time
import math
import plasma
import random
from plasma import plasma2040
from pimoroni import RGBLED, Analog

led_strip = plasma.WS2812 (1000, 0, 0, 0)
led_strip.start()

for i in range(0,720,2):
    led_strip.set_rgb(i, 0,255,0)
print("ye2")

```

I’m running this code on two different pi picos. On one, it runs correctly. On the other, it sets all the LEDs to white. Any ideas about what might be happening?

Thanks.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [March 18, 2024, 7:35pm UTC](https://forums.pimoroni.com/t/same-code-runs-different-on-two-different-picos/24475/2 "2024-03-18T19:35:27Z")

</div>

I have to ask the obvious. ;)  
Both flashed with the same UF2 file?  
And do both have the same LED strip attached?

EDIT: I’m not sure if this affects the Plasma 2040 but on my Plasma Stick I have to edit the RGB to GRB

`led_strip = plasma.WS2812(GRB_LEDS, 0, 0, plasma_stick.DAT, color_order=plasma.COLOR_ORDER_GRB)`

---

<div class="post-metadata">

**Author:** ![Joshy-J](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/joshy-j/32/8184_2.png) [@Joshy-J](https://forums.pimoroni.com/u/Joshy-J)\
**Post date:** [March 18, 2024, 7:40pm UTC](https://forums.pimoroni.com/t/same-code-runs-different-on-two-different-picos/24475/3 "2024-03-18T19:40:35Z")

</div>

It works now.

![Screenshot 2024-03-18 at 20.40.25](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/6/6d94830dbb6f6b7d5226cc8ce9f5de39a12a4e0f.png)

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [March 18, 2024, 7:41pm UTC](https://forums.pimoroni.com/t/same-code-runs-different-on-two-different-picos/24475/4 "2024-03-18T19:41:25Z")

</div>

I hate it when that happens, lol. =)

---

<div class="post-metadata">

**Author:** ![Joshy-J](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/joshy-j/32/8184_2.png) [@Joshy-J](https://forums.pimoroni.com/u/Joshy-J)\
**Post date:** [March 18, 2024, 7:42pm UTC](https://forums.pimoroni.com/t/same-code-runs-different-on-two-different-picos/24475/5 "2024-03-18T19:42:12Z")

</div>

Yeah, really knocks your confidence. I ate some toast and I think that fixed it???

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [March 18, 2024, 7:43pm UTC](https://forums.pimoroni.com/t/same-code-runs-different-on-two-different-picos/24475/6 "2024-03-18T19:43:37Z")

</div>

Did you maybe power cycle it / reset it, versus stop run?

---

<div class="post-metadata">

**Author:** ![bablokb](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bablokb](https://forums.pimoroni.com/u/bablokb)\
**Post date:** [March 19, 2024, 8:46am UTC](https://forums.pimoroni.com/t/same-code-runs-different-on-two-different-picos/24475/7 "2024-03-19T08:46:01Z")

</div>

Just be aware that you are dealing with hardware. And especially these ws2812 are tricky. If they don’t synchronize, you will have random colors. There are many reasons why this can happen.

---

<div class="post-metadata">

**Author:** ![Joshy-J](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/joshy-j/32/8184_2.png) [@Joshy-J](https://forums.pimoroni.com/u/Joshy-J)\
**Post date:** [March 19, 2024, 11:23am UTC](https://forums.pimoroni.com/t/same-code-runs-different-on-two-different-picos/24475/8 "2024-03-19T11:23:20Z")

</div>

Yeah, it was definitely unexpected behaviour and I thought I’d run into all the potential issues already. I’m pretty sure this was software related in the end as it was only when I ran the code that they went all white. But I don’t know what it was to be honest.
