diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..1c69c4c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "board.h": "c" + } +} diff --git a/README.md b/README.md index 3615336..f6ddf44 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/build_uf2/Pico_Game_Controller.uf2 b/build_uf2/Pico_Game_Controller.uf2 index 267e411..36c8fbe 100644 Binary files a/build_uf2/Pico_Game_Controller.uf2 and b/build_uf2/Pico_Game_Controller.uf2 differ diff --git a/src/controller_config.h b/src/controller_config.h index 394e029..7edc684 100644 --- a/src/controller_config.h +++ b/src/controller_config.h @@ -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 diff --git a/src/pico_game_controller.c b/src/pico_game_controller.c index 0e2032a..4516447 100644 --- a/src/pico_game_controller.c +++ b/src/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)); } }