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:
Nicholas G
2022-04-12 14:21:44 -04:00
parent be77dd763e
commit 1de18cf011
5 changed files with 10 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
{
"files.associations": {
"board.h": "c"
}
}
+1
View File
@@ -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.
+1
View File
@@ -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
+3 -2
View File
@@ -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));
}
}