embassy/examples/rp/src/bin/blinky.rs
2021-12-16 11:34:20 +01:00

28 lines
608 B
Rust

#![no_std]
#![no_main]
#![feature(type_alias_impl_trait)]
#[path = "../example_common.rs"]
mod example_common;
use defmt::*;
use embassy::executor::Spawner;
use embassy::time::{Duration, Timer};
use embassy_rp::{gpio, Peripherals};
use gpio::{Level, Output};
#[embassy::main]
async fn main(_spawner: Spawner, p: Peripherals) {
let mut led = Output::new(p.PIN_25, Level::Low);
loop {
info!("led on!");
led.set_high();
Timer::after(Duration::from_secs(1)).await;
info!("led off!");
led.set_low();
Timer::after(Duration::from_secs(1)).await;
}
}