diff --git a/examples/pico_tof_display/CMakeLists.txt b/examples/pico_tof_display/CMakeLists.txt index 16b4c9b4..90c9d20a 100644 --- a/examples/pico_tof_display/CMakeLists.txt +++ b/examples/pico_tof_display/CMakeLists.txt @@ -4,7 +4,7 @@ add_executable( ) # Pull in pico libraries that we need -target_link_libraries(tof_display pico_stdlib pico_explorer pico_display vl53l1x pico_graphics st7789 button) +target_link_libraries(tof_display pico_stdlib pico_explorer pico_display vl53l1x pico_graphics st7789 rgbled button) pico_enable_stdio_uart(tof_display 1) diff --git a/examples/pico_tof_display/pico_tof_display.cpp b/examples/pico_tof_display/pico_tof_display.cpp index 4b60b93e..f70219b2 100644 --- a/examples/pico_tof_display/pico_tof_display.cpp +++ b/examples/pico_tof_display/pico_tof_display.cpp @@ -25,6 +25,7 @@ #endif #include "vl53l1x.hpp" #include "drivers/button/button.hpp" +#include "drivers/rgbled/rgbled.hpp" #include "drivers/st7789/st7789.hpp" #include "libraries/pico_graphics/pico_graphics.hpp" @@ -55,6 +56,8 @@ uint16_t disptext_dist_size = 6; #else ST7789 st7789(PicoDisplay::WIDTH, PicoDisplay::HEIGHT, ROTATE_0, false, get_spi_pins(BG_SPI_FRONT)); +RGBLED rgbled(PicoDisplay::LED_R, PicoDisplay::LED_G, PicoDisplay::LED_B); + Button button_a(PicoDisplay::A); Button button_b(PicoDisplay::B); Button button_x(PicoDisplay::X); @@ -98,10 +101,10 @@ void flash_led(uint32_t curr_count) { #ifndef USE_PICO_EXPLORER if ((curr_count % FLASH_MOD) < (FLASH_MOD / 2)) { // value less than half modded number - LED off - //pico_display.set_led(0, 0, 0); // TODO use RGBLED + rgbled.set_rgb(0, 0, 0); } else { // value more than half modded number - LED on - //pico_display.set_led(128, 128, 128); // TODO use RGBLED + rgbled.set_rgb(128, 128, 128); } #endif }