blinking working
This commit is contained in:
24
external_led_blinky/src/bin/main.rs
Normal file
24
external_led_blinky/src/bin/main.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_stm32::gpio::{Level, Output, Speed};
|
||||
use embassy_time::{Duration, Timer};
|
||||
use embassy_stm32::init;
|
||||
use embassy_stm32::Config;
|
||||
use panic_halt as _;
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = init(Config::default());
|
||||
|
||||
let mut output_pin = Output::new(p.PA3, Level::Low, Speed::Low);
|
||||
let mut artificial_ground = Output::new(p.PB0, Level::Low, Speed::Low);
|
||||
|
||||
loop {
|
||||
output_pin.set_high();
|
||||
Timer::after(Duration::from_millis(500)).await;
|
||||
output_pin.set_low();
|
||||
Timer::after(Duration::from_millis(500)).await;
|
||||
}
|
||||
}
|
||||
1
external_led_blinky/src/lib.rs
Normal file
1
external_led_blinky/src/lib.rs
Normal file
@@ -0,0 +1 @@
|
||||
#![no_std]
|
||||
Reference in New Issue
Block a user