kopia lustrzana https://github.com/pimoroni/pimoroni-pico
Update tof display demo.
rodzic
d1b7639e8a
commit
7cc0cd2930
|
@ -4,7 +4,7 @@ add_executable(
|
||||||
)
|
)
|
||||||
|
|
||||||
# Pull in pico libraries that we need
|
# 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)
|
pico_enable_stdio_uart(tof_display 1)
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#endif
|
#endif
|
||||||
#include "vl53l1x.hpp"
|
#include "vl53l1x.hpp"
|
||||||
#include "drivers/button/button.hpp"
|
#include "drivers/button/button.hpp"
|
||||||
|
#include "drivers/rgbled/rgbled.hpp"
|
||||||
|
|
||||||
#include "drivers/st7789/st7789.hpp"
|
#include "drivers/st7789/st7789.hpp"
|
||||||
#include "libraries/pico_graphics/pico_graphics.hpp"
|
#include "libraries/pico_graphics/pico_graphics.hpp"
|
||||||
|
@ -55,6 +56,8 @@ uint16_t disptext_dist_size = 6;
|
||||||
#else
|
#else
|
||||||
ST7789 st7789(PicoDisplay::WIDTH, PicoDisplay::HEIGHT, ROTATE_0, false, get_spi_pins(BG_SPI_FRONT));
|
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_a(PicoDisplay::A);
|
||||||
Button button_b(PicoDisplay::B);
|
Button button_b(PicoDisplay::B);
|
||||||
Button button_x(PicoDisplay::X);
|
Button button_x(PicoDisplay::X);
|
||||||
|
@ -98,10 +101,10 @@ void flash_led(uint32_t curr_count) {
|
||||||
#ifndef USE_PICO_EXPLORER
|
#ifndef USE_PICO_EXPLORER
|
||||||
if ((curr_count % FLASH_MOD) < (FLASH_MOD / 2)) {
|
if ((curr_count % FLASH_MOD) < (FLASH_MOD / 2)) {
|
||||||
// value less than half modded number - LED off
|
// 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 {
|
} else {
|
||||||
// value more than half modded number - LED on
|
// 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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue