-
HW components
- ESP32-WROOM-32D target board
- SSD1306 monochrome display
- WS2813 RGB LED strip (16 LEDs)
-
SW components
- Connection layout
ESP32-WROOM-32D | SSD1306 | WS2813 |
---|---|---|
3V3 | VCC | n/c |
GND | GND | GND |
21 | SDA | n/c |
22 | SCL | n/c |
5V | n/c | 5V |
5 | n/c | DI |
note: n/c - not connected
- Effects with the RGB LED strip ('led_effects' example from an external ESP-IDF-LIB library: link)
1.1. Project development in Eclipse
- Assume the locations of the external ESP-IDF-LIB library and its example application are in:
$HOME/esp/esp-idf-lib # library
$HOME/esp/esp-idf-lib/examples/led_effects # example
- If the example project should be imported into the default Eclipse workspace, then use Eclipse menu commands:
- 'File' -> 'Import...' -> 'Espressif' -> 'Existing IDF Project': click on 'Next'
- On 'Import Existing Project' click on 'Browse...' to locate the existing project and click on 'Open'
- Re-name the project in 'Project Name' and enable the 'Copy project into workspace' checkbox
- Alternately, if the example project should be imported into other location (ie., 'eclipse-workspace/esp32'), use manual copy and then import it
- Copy the example directory into your desired location (and re-name the directory)
- Import it in Eclipse: nor copying in the workspace neigther re-naming of project is necessary
- 'File' -> 'Import...' -> 'Espressif' -> 'Existing IDF Project': click on 'Next'
- Edit 'CMakeLists.txt' to specify the external ESP-IDF-LIB library, otherwise compilation will fail (cannot find the included header files)
set(EXTRA_COMPONENT_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../../esp/esp-idf-lib/components)
- Now the project can be built properly with the external library
1.2. Run the application on the Wokwi online simulator
- Start the simulator on your web browser
- Start with the new project with the 'ESP32' board
- Load 'NeoPixel Ring' for WS2812 (yes, WS2812 and WS2813 are compatible)
- Make 2 connections:
ring1:GND - esp:GND.2
ring1:DIN - esp:D5
- On 'sketch.ino' tab press 'F1' button (or right click) to load the command palette
- Select 'Load HEX and start simulation' command
- Load your *.bin file:
led_effects/build/example-led_effects.bin # from the local project directory
- The simulation will run,
- debug output will be seen on the simulator serial monitor window
- LED ring will play the programmed effects
1.3. Run the app on the target board,
- idle current is 10,15 mA
- max current usage is 37,92 mA (default brightness=20)
- adjust the brightness in the SDK configuration:
- 'Example configuration' -> 'brightness of LEDs'
- with brightness=10, max current usage changes to 18,36 mA