Multiple colors in one effect

I want to create an effect where two LEDs light up white and two LEDs light up red (headlights white and taillights red). This doesn’t seem to be possible with the app itself. What other options are there?

Welcome to the forum!

You can set the colors independently. For each LED you specify the RGB value as a hexdecimal number. All White is 0xffffff, Red only is 0xFF0000.

I don’t have the documentation handy, but look in the Wiki for “setting LED color”.

I was aware of the RGB hex values, but I don’t know how that helps me here.

What I want to achieve is to combine both displayed modes into one.

1 Like

I can’t find anything in the wiki that helps me. Is it possible that I need to use the “Code” section for this? Is there a beginner’s guide for that?

Yes, I apologize for the misguidance. I don’t use the Cyberbrick code, but did remember that you had ‘some’ control of color. Unfortunately, their infrastructure is too weak to get what you want. If you search this category for ‘Code Snippets’ I ‘think’ there are some successful examples of inserting code to enhance the LED operations. In my case I simply use raw python.

That gave me the crucial push in the right direction. Thank you very much.

The code is very simple:

import machine
import neopixel

pin = machine.Pin(20, machine.Pin.OUT)
np = neopixel.NeoPixel(pin, 4)

np[0] = (255,255,255)
np[1] = (255,255,255)
np[2] = (8,0,0)
np[3] = (8,0,0)
np.write()
1 Like