feat: add Zigbee-controlled smart light
This commit is contained in:
1 parent
9793bc62af
commit
1aa6ba3c5f
10 files changed
+237
-99
No files matched your search
@@ -0,0 +1,30 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use embassy_time::Duration;
|
||||
use embassy_time::Timer;
|
||||
use esp_alloc as _;
|
||||
use esp_backtrace as _;
|
||||
use esp_hal::gpio::Level;
|
||||
use esp_hal::gpio::Output;
|
||||
use esp_hal::gpio::OutputConfig;
|
||||
use esp_hal::timer::timg::TimerGroup;
|
||||
|
||||
esp_bootloader_esp_idf::esp_app_desc!();
|
||||
|
||||
#[esp_rtos::main]
|
||||
async fn main(_spawner: embassy_executor::Spawner) -> ! {
|
||||
esp_println::logger::init_logger_from_env();
|
||||
let peripherals = esp_hal::init(esp_hal::Config::default());
|
||||
|
||||
let timers = TimerGroup::new(peripherals.TIMG0);
|
||||
esp_rtos::start(timers.timer0, peripherals.FROM_CPU_INTR0);
|
||||
esp_alloc::heap_allocator!(size: 8 * 1024);
|
||||
|
||||
let _pin = Output::new(peripherals.GPIO2, Level::High, OutputConfig::default());
|
||||
log::info!("GPIO diagnostic: holding GPIO2/D2 high");
|
||||
|
||||
loop {
|
||||
Timer::after(Duration::from_secs(1)).await;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user