Browse Source

make fastled work (finally)

main
Hendrik Langer 6 years ago
parent
commit
396225fae2
  1. 2
      software/platformio.ini
  2. 6
      software/src/led.cpp
  3. 4
      software/src/pusher.h
  4. 2
      software/src/shelf.cpp

2
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

6
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);
}

4
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:

2
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);
}

Loading…
Cancel
Save