Tweak to rotary, for consistency

pull/191/head
ZodiusInfuser 2021-08-18 12:19:10 +01:00
rodzic 64e6d248d5
commit c1cc505e0a
2 zmienionych plików z 9 dodań i 5 usunięć

Wyświetl plik

@ -1,6 +1,7 @@
add_executable(plasma2040_rotary plasma2040_rotary.cpp)
set(OUTPUT_NAME plasma2040_rotary)
add_executable(${OUTPUT_NAME} plasma2040_rotary.cpp)
target_link_libraries(plasma2040_rotary
target_link_libraries(${OUTPUT_NAME}
pico_stdlib
plasma2040
breakout_encoder
@ -9,4 +10,4 @@ target_link_libraries(plasma2040_rotary
button
)
pico_add_extra_outputs(plasma2040_rotary)
pico_add_extra_outputs(${OUTPUT_NAME})

Wyświetl plik

@ -16,6 +16,9 @@ using namespace pimoroni;
// Set how many LEDs you have
const uint N_LEDS = 30;
// How many times the LEDs will be updated per second
const uint UPDATES = 60;
// Pick *one* LED type by uncommenting the relevant line below:
// APA102-style LEDs with Data/Clock lines. AKA DotStar
@ -67,7 +70,7 @@ void gauge(uint v, uint vmax = 100) {
int main() {
stdio_init_all();
led_strip.start(60);
led_strip.start(UPDATES);
bool encoder_detected = enc.init();
enc.clear_interrupt_flag();
@ -147,6 +150,6 @@ int main() {
// Sleep time controls the rate at which the LED buffer is updated
// but *not* the actual framerate at which the buffer is sent to the LEDs
sleep_ms(1000 / 60);
sleep_ms(1000 / UPDATES);
}
}