fix up step 4
This commit is contained in:
@@ -5,7 +5,7 @@ led_strip_handle_t leds;
|
||||
void init_leds(void) {
|
||||
led_strip_config_t strip_config = {
|
||||
.strip_gpio_num = NEOPIXEL_PIN,
|
||||
.max_leds = PIXEL_COUNT,
|
||||
.max_leds = LED_COUNT,
|
||||
.led_pixel_format = LED_PIXEL_FORMAT_GRB,
|
||||
.led_model = LED_MODEL_WS2812
|
||||
};
|
||||
@@ -20,8 +20,8 @@ void init_leds(void) {
|
||||
}
|
||||
|
||||
void example_leds(void) {
|
||||
for (int i = 0; i < PIXEL_COUNT; i++) {
|
||||
ESP_ERROR_CHECK(led_strip_set_pixel(leds, i, i, PIXEL_COUNT-i, 0));
|
||||
for (int i = 0; i < LED_COUNT; i++) {
|
||||
ESP_ERROR_CHECK(led_strip_set_pixel(leds, i, i, LED_COUNT-i, 0));
|
||||
}
|
||||
ESP_ERROR_CHECK(led_strip_refresh(leds));
|
||||
}
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "led_strip.h"
|
||||
|
||||
#define PIXEL_COUNT 21
|
||||
#define LED_COUNT 21
|
||||
#define NEOPIXEL_PIN GPIO_NUM_7
|
||||
// 10MHz resolution, 1 tick = 0.1us (led strip needs a high resolution)
|
||||
#define LED_STRIP_RMT_RES_HZ (10 * 1000 * 1000)
|
||||
|
||||
@@ -77,6 +77,8 @@ void clear_wires_pressed_released_cut(void) {
|
||||
|
||||
void strike(char* reason) {
|
||||
ESP_LOGW("strike!", "%s", reason);
|
||||
lcd_set_cursor(&lcd, 0, 3);
|
||||
lcd_print(&lcd, reason);
|
||||
uint8_t reg = 6;
|
||||
ESP_ERROR_CHECK_WITHOUT_ABORT(i2c_master_write_to_device(WIRES_I2C_NUM, WIRES_I2C_ADDR, ®, 1, (100 / portTICK_PERIOD_MS)));
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <driver/i2c.h>
|
||||
#include <driver/gpio.h>
|
||||
#include <esp_log.h>
|
||||
#include "drivers/char_lcd.h"
|
||||
|
||||
#define WIRES_PIN_DELTA GPIO_NUM_2
|
||||
#define WIRES_I2C_NUM I2C_NUM_1
|
||||
|
||||
Reference in New Issue
Block a user