This example shows how to use the embedded JLed library with the ESP-IDF framework.
#include <jled.h>
extern "C" void app_main(void);
void app_main(void)
{
auto led = JLed(LED_PIN).Breathe(1500).Forever();
while(1) {
led.Update();
}
}
- main/ - example sketch with the program entry point
- components/ - Library dependencies - contains
JLed
as git submodule build/
- build artefacts
- Prerequisite: install and activate ESP-IDF SDK from https://github.com/espressif/esp-idf
- make sure to check out this repo with submodules by using e.g.
git clone --recursive https://github.com/jandelgado/jled-esp-idf-example
- Inspect the CMakeLists.txt file and adjust the
LED_PIN
#define
to your needs (GPIO where a LED is connected, e.g.2
for the builtin LED of the ESP-WROOM-32 board).
The following commands are used to configure, build and flash the image:
- run
idf.py build
to compile the example - run
idf.py flash
to flash the example on an ESP32 - optionally run
idf.py menuconfig
to configure the image (see (sdkconfig)[sdkconfig]) - run
idf.py clean
to clean up intermediary files
(C) Copyright 2022 by Jan Delgado, License: MIT