Skip to content

ftheile/blinking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32 blinking LEDs example

This repository contains a LED component. The LED component creates a software timer to flash the LED. The application in main/main.c uses that LED component. See Espressif's documentation of the Build System to get an understanding of the directory structure.

The application creates three LED instances to control the RGB LED on Espressif's WROVER kit.

The LED initializer led_init() passes the LED instance to the timer "constructor" xTimerCreate().

The LED flash function (static void blink(TimerHandle_t timer)) then uses pvTimerGetTimerID() to retrieve the LED instance from the passed timer handle.

Configure the project

idf.py menuconfig

The LED component has two configuration options in Component config -> My LED configuration:

  • CONFIG_LED_DYNAMIC_INSTANCE to enable functions for dynamic LED construction/destruction
  • CONFIG_LED_PULL_CURRENT to adjust for the wiring of the LED to the GPIO pin (push or pull)

Build the project

idf.py build

About

Example for Espressif ESP-IDF

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published