remove MAX_MODES
This commit is contained in:
11
README.md
11
README.md
@ -32,7 +32,8 @@ Professional LED controller firmware for ESP32. Designed for model aircraft with
|
|||||||
led-controller-firmware/
|
led-controller-firmware/
|
||||||
├── main/
|
├── main/
|
||||||
│ ├── main.c # Application entry point
|
│ ├── main.c # Application entry point
|
||||||
│ ├── control.c/h # NVS, initialization
|
│ ├── control.c/h # initialization
|
||||||
|
│ ├── config.c/h # NVS
|
||||||
│ ├── led.c/h # WS2812B control (RMT driver)
|
│ ├── led.c/h # WS2812B control (RMT driver)
|
||||||
│ ├── rcsignal.c/h # PWM signal reading
|
│ ├── rcsignal.c/h # PWM signal reading
|
||||||
│ ├── localbtn.c/h # Local btn reading
|
│ ├── localbtn.c/h # Local btn reading
|
||||||
@ -69,7 +70,7 @@ idf.py build
|
|||||||
idf.py -p /dev/ttyUSB0 flash monitor
|
idf.py -p /dev/ttyUSB0 flash monitor
|
||||||
```
|
```
|
||||||
|
|
||||||
Replace `/dev/ttyUSB0` with your serial port (COM3 on Windows).
|
Replace `/dev/ttyUSB0` with your serial port.
|
||||||
|
|
||||||
## Hardware Setup
|
## Hardware Setup
|
||||||
|
|
||||||
@ -80,6 +81,7 @@ ESP32 Pin -> Component
|
|||||||
GPIO XX -> WS2812B Strip A Data
|
GPIO XX -> WS2812B Strip A Data
|
||||||
GPIO XX -> WS2812B Strip B Data
|
GPIO XX -> WS2812B Strip B Data
|
||||||
GPIO XX -> RC PWM Signal
|
GPIO XX -> RC PWM Signal
|
||||||
|
GPIO XX -> Local button Signal
|
||||||
GND -> Common Ground
|
GND -> Common Ground
|
||||||
5V -> LED Strip Power (if current < 500mA)
|
5V -> LED Strip Power (if current < 500mA)
|
||||||
```
|
```
|
||||||
@ -103,11 +105,6 @@ GND -> Common Ground
|
|||||||
1. Add mode to `animation_mode_t` enum in `animation.h`
|
1. Add mode to `animation_mode_t` enum in `animation.h`
|
||||||
2. Implement animation function in `animation.c`
|
2. Implement animation function in `animation.c`
|
||||||
3. Add case to `animation_update()` switch statement
|
3. Add case to `animation_update()` switch statement
|
||||||
4. Update `MODE_NAMES` array in `webapp/app/app.js`
|
|
||||||
|
|
||||||
### Modifying LED Count
|
|
||||||
|
|
||||||
Edit `DEFAULT_NUM_LEDS_A` and `DEFAULT_NUM_LEDS_B` in `control.c`. TODO:
|
|
||||||
|
|
||||||
### Testing
|
### Testing
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,6 @@
|
|||||||
static const char *TAG = "ANIMATION";
|
static const char *TAG = "ANIMATION";
|
||||||
|
|
||||||
#define FRAMES_PER_SECOND 60
|
#define FRAMES_PER_SECOND 60
|
||||||
#define NUM_LEDS_DEFAULT 44 // TODO: Default from proof-of-concept
|
|
||||||
|
|
||||||
static animation_mode_t current_mode = ANIM_BLACK;
|
static animation_mode_t current_mode = ANIM_BLACK;
|
||||||
static uint8_t global_hue = 0;
|
static uint8_t global_hue = 0;
|
||||||
|
|||||||
@ -14,10 +14,7 @@
|
|||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
|
|
||||||
#define MAX_MODES 14 // TODO
|
|
||||||
|
|
||||||
static const char *TAG = "CONTROL";
|
static const char *TAG = "CONTROL";
|
||||||
|
|
||||||
static uint8_t current_animation_mode = 0;
|
static uint8_t current_animation_mode = 0;
|
||||||
|
|
||||||
// Forward declarations
|
// Forward declarations
|
||||||
@ -26,7 +23,7 @@ static void on_mode_change();
|
|||||||
// Animation mode change callback
|
// Animation mode change callback
|
||||||
static void on_mode_change()
|
static void on_mode_change()
|
||||||
{
|
{
|
||||||
current_animation_mode = (current_animation_mode + 1) % MAX_MODES;
|
current_animation_mode = (current_animation_mode + 1) % ANIM_MODE_COUNT;
|
||||||
animation_set_mode((animation_mode_t)current_animation_mode);
|
animation_set_mode((animation_mode_t)current_animation_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user