Giter VIP home page Giter VIP logo

esp32-c3-32s-kit-example's Introduction

Rust on ESP-C3-32S-Kit board

A simple Rust example for the ESP-C3-32S-Kit ESP32 WiFi+Bluetooth Development Board with ESP32C3 chip from Waveshare. This example uses the std implementation.

Highlights:

  • No external periphery needed, just the board
  • Small but not just an empty "hello world" example
  • Available custom bootloader and partition tables for this board
  • Preconfigured runner, just call cargo run

This example is still work in progress! Current open tasks:

  • Example builds and turns on both the amber and white built-in leds and the RGB led. It also has some basic polling of the built-in button
  • Usage of built-in button to change the mode
  • Control of built-in RGB LED using PWM

Motivation and goals

This is my simple example to learn Rust beginning with the board ESP-C3-32S-Kit I purchased from Waveshare. It uses the built-in periphery (LEDs and button) to demonstrate basic concepts.

Preparation

  • Install the nightly toolchain of Rust: rustup toolchain install nightly
  • Make sure the toolchains are up to date: rustup update
  • Switch to nightly: rustup override set nightly
  • Install ldproxy: cargo install ldproxy
  • Install espflash and espmonitor crates: cargo install espflash espmonitor

Build & run

To build the project (this step is optional)

cargo build

To build, flash and monitor the output (all in one step thanks to preconfigured runner, be aware that it assumes that you are using /dev/ttyUSB0):

cargo run

If you need more control or other parameters, you can use the espflash and espmonitor commands instead (see the Credits and acknowledgment for more details on how to do this).

Credits and acknowledgment

For this example I used the template in https://github.com/esp-rs/esp-idf-template to create the initial files. Furthermore this exmaple is heavily inspired by:

You can check those for better instructions on how to use espflash and espmonitor and other details I don't cover here.

Disclaimers

  • I am a beginner at Rust and ESP32 boards. Don't take my implementation as best practice! I don't really understand every single line of code of my example, which I have partly copied from the template and other examples.
  • Still, I am very grateful if you have comments or improvement proposals. Don't hesitate to open issues!
  • I have tested this example using my own board. This might not work well with other ESP32C3 boards. Use this at your own risk.
  • I believe that you don't need to install ESP_IDF as well (see https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/get-started/index.html), but I am not very sure about this yet.

License

Copyright (c) 2022 javiser esp32-c3-32s-kit-example is distributed under the terms of the MIT License.

See the LICENSE for license details.

esp32-c3-32s-kit-example's People

Contributors

javiser avatar sirhcel avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.