thomson

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit c2e813ce07affd49e117216ac0833e7f25fd1ccf
parent da343e698b90ccde73d4808aae95bf1c19f7f52f
Author: Daniel Barlow <dan@telent.net>
Date:   Fri, 19 Jun 2026 00:07:55 +0100

blink led

Diffstat:
Msrc/bin/main.rs | 12++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/bin/main.rs b/src/bin/main.rs @@ -10,8 +10,12 @@ use defmt::info; use embassy_executor::Spawner; use embassy_time::{Duration, Timer}; -use esp_hal::clock::CpuClock; -use esp_hal::timer::timg::TimerGroup; +use esp_hal::{ + clock::CpuClock, + timer::timg::TimerGroup, + gpio::{Level, Output, OutputConfig} +}; + use esp_radio::ble::controller::BleConnector; use panic_rtt_target as _; @@ -54,9 +58,13 @@ async fn main(spawner: Spawner) -> ! { // TODO: Spawn some tasks let _ = spawner; + let mut led = Output::new(peripherals.GPIO8, Level::Low, OutputConfig::default()); + led.set_high(); + loop { info!("Hello world!"); Timer::after(Duration::from_secs(1)).await; + led.toggle(); } // for inspiration have a look at the examples at https://github.com/esp-rs/esp-hal/tree/esp-hal-v1.1.0/examples