Skip to content

Commit 5ebc172

Browse files
committed
blog: bevy - include demo as iframe
1 parent 70b5733 commit 5ebc172

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed
5.87 KB
Loading

content/blog/bevy-ecs-on-esp32-with-rust-no-std/index.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
title: "Bevy Entity Component System on ESP32 with Rust no_std"
3-
date: "2025-03-06"
3+
date: "2025-04-06"
44
showAuthor: false
55
authors:
66
- "juraj-michalek"
7-
tags: ["Embedded Systems", "ESP32", "Rust", "Bevy ECS", "no_std", "ECS", "WASM"]
7+
tags: ["Embedded Systems", "ESP32", "ESP32-S3", "ESP32-C3", "Rust", "Bevy", "no_std", "ECS", "WASM"]
88
---
99

1010
## Introduction
@@ -19,17 +19,27 @@ In this article, we demonstrate how to build an embedded application using Rust
1919
on an ESP32 device, using a simulation of [Conway’s Game of Life](https://github.com/georgik/esp32-conways-game-of-life-rs) and
2020
[ESP32 Spooky Maze Game](https://github.com/georgik/esp32-spooky-maze-game) as our examples.
2121

22-
Although Conway’s Game of Life is a classic cellular automaton,
23-
our focus is on showcasing how to structure an embedded application using Bevy ECS principles.
22+
<div style="text-align:center; margin: 20px 0;">
23+
<iframe
24+
src="https://georgik.github.io/esp32-conways-game-of-life-rs/"
25+
width="640"
26+
height="480"
27+
style="border: none; overflow: hidden;"
28+
scrolling="no"
29+
title="Conway's Game of Life WASM Demo">
30+
</iframe>
31+
</div>
2432

25-
This approach not only helps organize code into clean, modular systems for interactive and data intensive applications.
33+
Although Conway’s Game of Life is a classic cellular automaton, our primary focus is on structuring embedded applications using Bevy ECS principles.
34+
35+
This approach helps organize code into clean, modular systems, ideal for interactive and data-intensive applications.
2636

2737
<video controls width="640">
2838
<source src="https://github.com/user-attachments/assets/e9d48ff7-b14c-4874-9521-fe59e915bc76" type="video/mp4">
2939
View the video [here](https://github.com/user-attachments/assets/e9d48ff7-b14c-4874-9521-fe59e915bc76).
3040
</video>
3141

32-
The second example Spooky Maze Game is more complex and demonstrates how to connect peripherals like accelerometer with application code using even based approach.
42+
The second example, the Spooky Maze Game, is more complex, demonstrating an event-based approach to integrate peripherals like accelerometers with application logic.
3343

3444
<video src="https://github.com/user-attachments/assets/28ef7c2b-42cc-4c79-bbdb-fcb0740bf533" controls width="320">
3545
View the video [here](https://github.com/user-attachments/assets/28ef7c2b-42cc-4c79-bbdb-fcb0740bf533).
@@ -42,6 +52,10 @@ Bevy ECS is the core data‑oriented architecture of the Bevy game engine. It pr
4252

4353
## Advantages for Embedded Rust Developers
4454

55+
Many advantages of Rust for embedded development were described in the article [Rust + Embedded: A Development Power Duo](https://developer.espressif.com/blog/rust-embedded-a-development-power-duo/).
56+
57+
Here are some specific advantages of using ECS in Rust applications:
58+
4559
- **Modularity and Maintainability:** ECS encourages the separation of data and behavior into independent systems, which leads to clearer, easier-to-maintain code.
4660
- **Efficient Resource Management:** The data‑oriented design can lead to better cache utilization and efficient processing, critical for devices with limited memory and processing power.
4761
- **Scalability:** Even on microcontrollers, ECS allows you to extend your application with additional features or behaviors without significant restructuring.
@@ -53,9 +67,8 @@ Bevy ECS is the core data‑oriented architecture of the Bevy game engine. It pr
5367

5468
- **ESP32 Development Board:** ESP32-S3, ESP32-C3, or similar variants.
5569
- **Display Module:** For example, an ILI9486-based display connected via SPI.
56-
- **Additional Peripherals:** Optional buttons, sensors, or LEDs depending on your project.
5770

58-
If you're not sure which Hardware to pick, we recommend [ESP32-S3-BOX-3](https://github.com/espressif/esp-box?tab=readme-ov-file#esp-box-aiot-development-framework) which features ESP32-S3 with PSRAM and display with touch controller.
71+
If you're uncertain which hardware to choose, we recommend the [ESP32-S3-BOX-3](https://github.com/espressif/esp-box?tab=readme-ov-file#esp-box-aiot-development-framework) featuring ESP32-S3 with PSRAM and a display with touch control.
5972

6073
### Software Requirements
6174

@@ -65,9 +78,9 @@ If you're not sure which Hardware to pick, we recommend [ESP32-S3-BOX-3](https:/
6578

6679
## Building the Application
6780

68-
Our example implements Conway’s Game of Life, where the simulation grid is managed as an ECS resource. The Bevy ECS world organizes systems for updating the game state and rendering to an offscreen framebuffer, which is then flushed to a physical display. We will showcase also an option to use WASM for rendering the same application in the web browser.
81+
The Conway’s Game of Life example manages a simulation grid as an ECS resource. Systems update the game state and render to an off-screen framebuffer, which is then output to a physical display. A WASM version also simulates the display using an HTML canvas in a web browser.
6982

70-
For ESP32-based projects, the code is compiled as a bare‑metal Rust application using no_std. Flashing the binary onto your hardware is done using [espflash](https://github.com/esp-rs/espflash) or [probe-rs](https://github.com/probe-rs/probe-rs) configured in [`.config/cargo.toml`](https://github.com/georgik/esp32-conways-game-of-life-rs/blob/main/esp32-c3-lcdkit/.cargo/config.toml). For the WASM version, the application runs in the browser by simulating a display via an HTML canvas.
83+
For ESP32-based projects, the code is compiled as a bare‑metal Rust application using no_std. Flashing the binary onto your hardware is done using [espflash](https://github.com/esp-rs/espflash) or [probe-rs](https://github.com/probe-rs/probe-rs) configured in [`.config/cargo.toml`](https://github.com/georgik/esp32-conways-game-of-life-rs/blob/main/esp32-c3-lcdkit/.cargo/config.toml).
7184

7285
## Installing tooling
7386

0 commit comments

Comments
 (0)