https://github.com/alexandrehiroyuki/esp32_practice_sketches
Practice with ESP32 and PlatformIO. Task management, HTTP requests and Unit Tests.
https://github.com/alexandrehiroyuki/esp32_practice_sketches
esp32
Last synced: about 2 months ago
JSON representation
Practice with ESP32 and PlatformIO. Task management, HTTP requests and Unit Tests.
- Host: GitHub
- URL: https://github.com/alexandrehiroyuki/esp32_practice_sketches
- Owner: AlexandreHiroyuki
- Created: 2022-06-29T19:03:21.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-09T10:15:24.000Z (about 2 years ago)
- Last Synced: 2025-02-02T04:44:44.305Z (over 1 year ago)
- Topics: esp32
- Language: C++
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# ESP32 Practice Sketches
## Introduction
This is my first attempt at a sketch for the ESP32. I tried to explore the many features of the ESP32 and the PlatformIO ecosystem.
## Main Features
Using the ESP FreeRTOS, I created two tasks that switches the built-in LED and an external LED on and off.
Both tasks are running the same function at the same priority. The way it differs is which argument is passed to the function. The first task is passed the built-in LED pin and delay, the second task is passed the external LED pin and delay.
Also, on the main loop, the ESP32 makes HTTP requests to the server and prints the response.
## Environment Header
Inspired by the .env module used on node.js, I created a header file that contains the variables that are used in the sketch.
You can easily add new variables to the header file, just copy the `env-model.h` and rename it to `env.h`.
The variables `SSID` and `PASSWORD` are used to connect to the WiFi network.
## Practice Server
The `/server` folder contains the server that is used to make HTTP requests to the ESP32.
```
cd server
yarn
yarn start
```
## Unit Tests
The `/tests` folder contains the unit tests for the sketch.
[Unit Test Espressif Documentation](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/unit-tests.html)
[Unit Test PlatformIO Documentation](https://docs.platformio.org/en/latest/advanced/unit-testing/index.html)