From 396225fae24c64894a8a10e6b66f4530adc7c58e Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Tue, 23 Jan 2018 09:34:04 +0100 Subject: [PATCH] make fastled work (finally) --- software/platformio.ini | 2 ++ software/src/led.cpp | 6 +++++- software/src/pusher.h | 4 +--- software/src/shelf.cpp | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/software/platformio.ini b/software/platformio.ini index 02e4b78..2476a51 100644 --- a/software/platformio.ini +++ b/software/platformio.ini @@ -12,6 +12,8 @@ platform = https://github.com/platformio/platform-espressif32.git#feature/stage ;platform = espressif32 board = esp32dev +board_f_cpu = 160000000L +board_f_flash = 80000000L framework = arduino ;build_flags = -DASYNC_TCP_SSL_ENABLED=1 build_flags = -fexceptions diff --git a/software/src/led.cpp b/software/src/led.cpp index f89d0c1..2c8bc7e 100644 --- a/software/src/led.cpp +++ b/software/src/led.cpp @@ -111,7 +111,11 @@ void Led::animationTask(void* parameters) { } else { duration--; } - EVERY_N_SECONDS(300) { changeAnimation(3, 200); } + EVERY_N_SECONDS(300) { +// FastLED.clear(); +// delay(200); + changeAnimation(3, 400); + } } vTaskDelay(50 / portTICK_PERIOD_MS); } diff --git a/software/src/pusher.h b/software/src/pusher.h index d98fb81..acac863 100644 --- a/software/src/pusher.h +++ b/software/src/pusher.h @@ -14,11 +14,9 @@ static constexpr uint16_t PROGMEM MIN_PULSE_WIDTH = (1 << TIMER_WIDTH) * MIN static constexpr uint16_t PROGMEM MAX_PULSE_WIDTH = (1 << TIMER_WIDTH) * MAX_PULSE_MS / 20000; // the longest pulse sent to a servo static constexpr uint16_t PROGMEM DEFAULT_PULSE_WIDTH = (1 << TIMER_WIDTH) * DEFAULT_PULSE_MS / 20000; // default pulse width -static constexpr uint8_t PROGMEM LEDC_NUM_CHANNELS = 8; // default pulse width - static constexpr TickType_t PROGMEM TIMEOUT = portMAX_DELAY; -static constexpr uint8_t PROGMEM channel = 13; // LEDC_CHANNEL_3 // beware: some channels interfere with the rmt peripheral used by FastLED +static constexpr uint8_t PROGMEM channel = LEDC_CHANNEL_5; // 13 // beware: some channels interfere with the rmt peripheral used by FastLED class Pusher { public: diff --git a/software/src/shelf.cpp b/software/src/shelf.cpp index 629aead..135a118 100644 --- a/software/src/shelf.cpp +++ b/software/src/shelf.cpp @@ -38,7 +38,7 @@ void Shelf::dispenseTask(void* parameters) { vTaskDelay(7000 / portTICK_PERIOD_MS); led.changeAnimation(0, 0); } else { - led.changeAnimation(4,500); + led.changeAnimation(4,200); } vTaskDelete(NULL); }