mirror of
https://github.com/speedypotato/Pico-Game-Controller.git
synced 2026-10-08 06:38:07 +03:00
Added brightness multiplier
NOTE: PICO_XOSC_STARTUP_DELAY_MULTIPLIER MUST BE CHANGED FROM 1 TO 64 in pico-sdk/src/rp2_common/hardware_xosc/include/hardware/xosc.h https://forums.raspberrypi.com/viewtopic.php?t=317631
This commit is contained in:
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"files.associations": {
|
||||
"board.h": "c"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
# Pico-Game-Controller
|
||||
NOTE: PICO_XOSC_STARTUP_DELAY_MULTIPLIER MUST BE CHANGED FROM 1 TO 64 in pico-sdk/src/rp2_common/hardware_xosc/include/hardware/xosc.h
|
||||
|
||||
This branch was developed with SDVX in mind. Capable of handling 7 LEDs, 1 WS2812B RGB strip, and 2 encoders.
|
||||
|
||||
|
||||
Binary file not shown.
@@ -11,6 +11,7 @@
|
||||
#define REACTIVE_TIMEOUT_MAX 1000000 // HID to reactive timeout in us
|
||||
#define WS2812B_LED_SIZE 32 // Number of WS2812B LEDs
|
||||
#define WS2812B_LED_ZONES 1 // Number of WS2812B LED Zones
|
||||
#define WS2812B_BRIGHTNESS 0.5 // Brightness adjustment
|
||||
|
||||
#ifdef PICO_GAME_CONTROLLER_C
|
||||
|
||||
|
||||
@@ -171,8 +171,9 @@ void update_peripheral_lights(uint32_t counter) {
|
||||
**/
|
||||
void ws2812b_update() {
|
||||
for (int i = 0; i < WS2812B_LED_SIZE; i++) {
|
||||
put_pixel(
|
||||
urgb_u32(ws2812b_data[i].r, ws2812b_data[i].g, ws2812b_data[i].b));
|
||||
put_pixel(urgb_u32(ws2812b_data[i].r * WS2812B_BRIGHTNESS,
|
||||
ws2812b_data[i].g * WS2812B_BRIGHTNESS,
|
||||
ws2812b_data[i].b * WS2812B_BRIGHTNESS));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user