Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cdfer/ring-buffer-demo-esp32-arduino
A demo project showcasing the use of FreeRTOS ring buffers on the ESP32 platform with Arduino. This project demonstrates how to create, send, and receive data using ring buffers, providing a basic example for embedded systems development.
https://github.com/cdfer/ring-buffer-demo-esp32-arduino
arduino circular-buffer data-structure efficient-data-transfer esp32 fifo freertos real-time-systems ring-buffer streaming-data
Last synced: about 1 month ago
JSON representation
A demo project showcasing the use of FreeRTOS ring buffers on the ESP32 platform with Arduino. This project demonstrates how to create, send, and receive data using ring buffers, providing a basic example for embedded systems development.
- Host: GitHub
- URL: https://github.com/cdfer/ring-buffer-demo-esp32-arduino
- Owner: CDFER
- License: mit
- Created: 2024-05-03T08:01:27.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-05-05T08:25:22.000Z (7 months ago)
- Last Synced: 2024-05-05T09:28:28.254Z (7 months ago)
- Topics: arduino, circular-buffer, data-structure, efficient-data-transfer, esp32, fifo, freertos, real-time-systems, ring-buffer, streaming-data
- Language: C++
- Homepage:
- Size: 763 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Circular Buffer Demo for ESP32 (Arduino)
=============================================This project is licensed under the MIT License. See the LICENSE file for details.
This project demonstrates the use of circular buffers for efficient data transfer on the ESP32 board using the Arduino framework. Circular buffers are a type of data structure that stores data in a continuous loop, making them suitable for streaming data and real-time systems.
What is a Circular Buffer?
-------------------------A circular buffer is an array of constant length that stores data in a continuous loop. Data is read from the buffer in a FIFO (first in, first out) manner, meaning that the oldest data is read first. The terms "circular buffer" and "ring buffer" are often used interchangeably to refer to this type of data structure.
### Benefits
* Store data in a continuous loop
* Read data in a FIFO (First-In-First-Out) manner
* Suitable for streaming data and real-time systems
* Efficient use of memory
* Simple implementation### Limitations
* Can only store a predetermined maximum number of elements
* Requires knowledge of the maximum size beforehand## Code Overview
The `ringBufferDemo()` function demonstrates the use of circular buffers for efficient data transfer. It sends a message to the ring buffer, receives data from the ring buffer, and prints the received message to the serial monitor.## Run on WokWi ESP32 Emulator
https://wokwi.com/projects/396851809084022785## Local Setup
1. Open the project in the Arduino IDE.
2. Connect your ESP32 board to your computer.
3. Upload the sketch to the board.
4. Open the serial monitor to view the output.## Portability
This code is written for the ESP32 board using the Arduino framework, but it should be easily translatable to other Arduino boards that support FreeRTOS and the optional FreeRTOS/ringbuf.h component. Additionally, with some modifications, it should also be possible to use this code with ESP-IDF or other platforms that support FreeRTOS.### Acknowledgments
Thanks to the FreeRTOS team for their contributions to the FreeRTOS project. Also, thanks to the Espressif IDF team for their documentation on FreeRTOS ring buffers. https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/freertos_additions.html
Circular Buffer Animation By MuhannadAjjan - Own work, CC BY-SA 4.0### Raise an Issue
If you have any questions or issues, please raise an issue on this repository.