Is there a code snippet which can be utilized within the cyber brick ecosystem which will adjust the brightness of the included LED pixels?
Currently there are only two choices within the applications each LED. “Steady” and “Blink”. But not a selection for changing brightness.
2 Likes
MaKim
June 19, 2025, 10:03pm
2
Here’s an example of a code snippet that can change the color of an LED to a given RGB value. This one changes the value of the LED on the actual receiver board but you could adjust it to change the value for a connected LED. More info can be found in this section of the documentation .
import machine
import neopixel
pin = machine.Pin(8, machine.Pin.OUT)
np = neopixel.NeoPixel(pin, 1)
np[0] = (255, 0, 0)
np.write()
1 Like
xrk
June 25, 2025, 11:43am
3
There are 3 serial “NeoPixel” LED strings defined on CyberBrick Core MicroPython code:
GPIO Pin 8 - single NeoPixel LED on CyberBrick Core PCB
GPIO Pin 20 - NeoPixel LED channel 2 (default code supports up to 4 LEDs)
GPIO Pin 21 - NeoPixel LED channel 1 (default code supports up to 4 LEDs)
For more about the pin-mapping, see: Where is documentation on building applications for Cyberbrick? - #17 by xrk
Note that the latter two NeoPixel strings are not available with the X12 transmitter module!
Interestingly, the default code does not make use of MicroPython neopixel library, but uses machine.bitstream instead: CyberBrick_Controller_Core/src/app_rc/bbl/leds.py at b5fc07d44d65143cfef1164ae6234099fcb11d62 · CyberBrick-Official/CyberBrick_Controller_Core · GitHub
That is interesting. Thank you for the information. I looked at the other thread link of information you provided. Very well done!
1 Like
TomWS
June 26, 2025, 12:24pm
5
You can control brightness statically (not in real time) in the configuration LED color Hex value. Where 0xff0000 would be pure red bright, 0x3f0000 would be pure red, but 1/4 brightness.
1 Like
That is a very good observation and suggestion thank you!