Compare commits

...

2 Commits

Author SHA1 Message Date
5ea3df10a4 leds 2026-04-01 22:11:54 -05:00
9578c81dc0 update to inputs 2026-04-01 16:32:19 -05:00
4 changed files with 30 additions and 4 deletions

@ -1 +1 @@
Subproject commit c82c9adf321b6e653c8069758f226d931fc39d9f
Subproject commit 0b79eb839961095ddf2b1a1a07479a791871acc6

View File

@ -1,10 +1,21 @@
dependencies:
espressif/led_strip:
component_hash: 28621486f77229aaf81c71f5e15d6fbf36c2949cf11094e07090593e659e7639
dependencies:
- name: idf
require: private
version: '>=5.0'
source:
registry_url: https://components.espressif.com/
type: service
version: 3.0.3
idf:
source:
type: idf
version: 6.0.0
direct_dependencies:
- espressif/led_strip
- idf
manifest_hash: 358b3aa9e74271a73347d172c5db1dd47acf31327fbda2257d6bdd67a24e3d2a
manifest_hash: d8fb11fe9d2246f588be185955562c86050e5dc4c222815277426614f2136bfe
target: esp32s3
version: 3.0.0

View File

@ -2,7 +2,7 @@
dependencies:
## Required IDF version
idf:
version: ">=6.0.0"
version: '>=6.0.0'
# # Put list of dependencies here
# # For components maintained by Espressif:
# component: "~1.0.0"

View File

@ -8,7 +8,8 @@
#include "esp_system.h"
#include "blk_box.h"
#include "blk_box_drivers/i2c.h"
#include "blk_box_drivers/expander.hpp"
#include "blk_box_drivers/inputs.hpp"
#include "blk_box_drivers/leds.hpp"
extern "C" void app_main(void) {
BlkBoxInitConfig blk_box_cfg = {};
@ -16,10 +17,23 @@ extern "C" void app_main(void) {
printf("Hello, Blk Box!\n");
uint32_t i = 0;
while (1) {
if (InputsController::has_button_press()) {
Button b = InputsController::wait_button_press();
printf("Button pressed: %d\n", raw_value(b));
if (b == Button::GREEN) {
LEDController::set_indicator(static_cast<IndicatorLED>(i + LED_SHAPE_COUNT), LEDColor::GREEN);
LEDController::flush();
} else if (b == Button::YELLOW) {
LEDController::set_indicator(static_cast<IndicatorLED>(i + LED_SHAPE_COUNT), LEDColor::YELLOW);
LEDController::flush();
} else if (b == Button::RED) {
i = (i + 1) % LED_INDICATOR_COUNT;
} else if (b == Button::BLUE) {
i = (i + LED_INDICATOR_COUNT - 1) % LED_INDICATOR_COUNT;
}
}
if (InputsController::has_switch_flip()) {
@ -30,6 +44,7 @@ extern "C" void app_main(void) {
if (InputsController::has_keypad_press()) {
KeypadKey k = InputsController::wait_keypad_press();
printf("Keypad key pressed: %c\n", keypad_key_to_char(k));
LEDController::flush();
}
vTaskDelay(10 / portTICK_PERIOD_MS);