{"id":25346464,"url":"https://github.com/m1kc3b/rust-on-esp32","last_synced_at":"2026-05-16T17:41:45.765Z","repository":{"id":270234857,"uuid":"909645007","full_name":"m1kc3b/rust-on-esp32","owner":"m1kc3b","description":"Bare metal programing with Rust on an ESP32 (no_std, esp-idf and async/await)","archived":false,"fork":false,"pushed_at":"2025-02-24T11:29:16.000Z","size":88151,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T17:21:28.456Z","etag":null,"topics":["bare-metal","embedded","esp32","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m1kc3b.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-29T11:08:20.000Z","updated_at":"2025-02-24T11:29:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"21a57b7b-b0f7-4ecb-96ef-36bf878b3e67","html_url":"https://github.com/m1kc3b/rust-on-esp32","commit_stats":null,"previous_names":["m1ckc3b/rust-on-esp32","m1kc3b/rust-on-esp32"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/m1kc3b/rust-on-esp32","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1kc3b%2Frust-on-esp32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1kc3b%2Frust-on-esp32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1kc3b%2Frust-on-esp32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1kc3b%2Frust-on-esp32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m1kc3b","download_url":"https://codeload.github.com/m1kc3b/rust-on-esp32/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1kc3b%2Frust-on-esp32/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278881947,"owners_count":26062196,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bare-metal","embedded","esp32","rust"],"created_at":"2025-02-14T13:36:27.150Z","updated_at":"2025-10-08T03:08:26.188Z","avatar_url":"https://github.com/m1kc3b.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust on ESP32\n\nI purchased a basic ESP32 starter kit created by Lafvin with the plan to build each of the 10 projects with Rust instead of Arduino as the documentation calls for. This kit provides an ESP32-WROOM-32 and I also bought an ESP32c3-DevKitm-1 and a Raspberry Pi Pico W to practice on different microcontroller architectures (xtensa, RISC-V and Cortex-M0+ respectively). In this repo I focused on ESPs and I dedicated another [repo to the Pico W](https://github.com/m1ckc3b/rust-on-picoW).\n\n\nBare-programming with Arduino is easier than with Rust because of the abstraction layers offers by the sdk but Rust gives us more power to handle the bare-metal with high-level programing style even if it is more verbose.\n\nOn ESP32 one can develop as with any other microcontroller by using no_std mode. But thanks to the esp-idf-svc crate (IDF means IoT Development Framework) one can use Rust as usual, that means on std mode. So I used one or the other depending on the type of the project. When it was needed to implement a web server I chose to use the std mode (with esp-idf-svc as framework) instead of implement all from scratch. \n\nFor each project, I provide a breadboard schema, a list of components and the arduino code (perhaps I gona upload videos of the finish projects).\n\n\u003cimg src=\"./microcontrollers.jpg\" alt=\"ESP32 ESP32c3 and Raspberry pi Pico W\" width=\"600\" /\u003e\n\n## Projects\n\nHere is the list of projects:\n\n### [Project_0](./project_0/) - Hello World + Blinky\n\nThe first simple project when one begins in bare-metal programming.\n\n```\ntarget = ESP32\ntype = no_std\n```\n\n### [Project_1](./project_1/) - Blinky\n\nSimple project with a pushbutton and an LED.\n\n```\ntarget = ESP32\ntype = no_std\n```\n\n### [Project_2](./project_2/) - Analog Inputs (ADC)\n\nReading an analog voltage value varying between 0V and 3.3V. The voltage measured is then assigned to a value between 0 (0V) and 4095 (3.3V) because the value has 12-bit resolution.\n\n```\ntarget = ESP32\ntype = no_std\n```\n\n\n### [Project_3](./project_3/) - PWM Analog Output\n\nUsing the PWM protocol to increase/decrease the LED brightness with a resolution of 12 bits and a frequency of 4 Khz.\n\n```\ntarget = ESP32\ntype = no_std\n```\n\n![image](./project_3.gif)\n\n\n### [Project_4](./project_4/) - PIR Motion Sensor\n\nWhen motion is detected the buzzer will sound an alarm during 500 milliseconds.\n\n```\ntarget = ESP32\ntype = no_std\n```\n\n\n### [Project_5](./project_5/) - Switch Web Server\n\nCreating a standalone web server that controls (outputs) two Leds. The web server must be mobile responsive and can be accessed with any device that as a browser on the local network.\n\n```\ntarget = ESP32\ntype = std\n```\n\n![image](./project_5.gif)\n\n### [Project_6](./project_6/) - RGB LED Web Server\n\nCreating a web sever to change the color of a RGB LED. The web server must be mobile responsive and can be accessed with any device that as a browser on the local network.\n\n```\ntarget = ESP32c3\ntype = std\n```\n\n![image](./project_6.gif)\n\n### [Project_7](./project_7/) - Relay Web Server\n\nCreating a web server to control electrical appliances remotely thanks to a relay. Abviously, the web server must be responsive and accessible from any device.\n\n```\ntarget = ESP32c3\ntype = std\n```\n![image](./project_7.gif)\n\n### [Project_8](./project_8/) - Output State Synchronization Web Server\n\nControlling ESP outputs by using a web server and/or a physical button. The output state is updated on the web page wether it is changed via physical button or web server.\n\n```\ntarget = ESP32c3\ntype = no_std + async\n```\n\n### Project_9 - DHT11 Web Server\n\n### Project_10 - OLED Display\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm1kc3b%2Frust-on-esp32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm1kc3b%2Frust-on-esp32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm1kc3b%2Frust-on-esp32/lists"}