mirror of
https://github.com/kittywitch/esp32-c3-meepy.git
synced 2026-02-09 07:59:18 -08:00
feat: initial commit
This commit is contained in:
commit
7888da2541
10 changed files with 1515 additions and 0 deletions
33
src/main.rs
Normal file
33
src/main.rs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use esp_backtrace as _;
|
||||
use esp_hal::{
|
||||
delay::Delay,
|
||||
gpio::{Level, Output, OutputConfig},
|
||||
main,
|
||||
};
|
||||
use esp_println::println;
|
||||
|
||||
esp_bootloader_esp_idf::esp_app_desc!();
|
||||
|
||||
#[main]
|
||||
fn main() -> ! {
|
||||
let peripherals = esp_hal::init(esp_hal::Config::default());
|
||||
|
||||
println!("Hello world!");
|
||||
|
||||
// Set GPIO7 as an output, and set its state high initially.
|
||||
let mut led = Output::new(peripherals.GPIO8, Level::Low, OutputConfig::default());
|
||||
|
||||
led.set_high();
|
||||
|
||||
// Initialize the Delay peripheral, and use it to toggle the LED state in a
|
||||
// loop.
|
||||
let delay = Delay::new();
|
||||
|
||||
loop {
|
||||
led.toggle();
|
||||
delay.delay_millis(500);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue