Embassy enables async programming on embedded devices by providing a runtime to execute async functions without an OS.
Embassy is an async runtime for embedded Rust that executes async functions without an operating system. Add embassy-executor to your Cargo.toml and spawn tasks using #[embassy_executor::main].
[dependencies]
embassy-executor = { version = "0.7", features = ["task-arena-size-65536"] }
use embassy_executor::Spawner;
#[embassy_executor::main]
async fn main(_spawner: Spawner) {
// Your async logic here
}
Embassy lets you write asynchronous code for microcontrollers that don't have an operating system. It manages running multiple tasks at once so your device can handle sensors, networks, and displays simultaneously without freezing. Think of it as a traffic controller for your code that switches between tasks instantly.