// Simplified Embedded Rust
// Core Library Edition
// CH8-Q7 Wiring Template
// Build a door lock system using the keypad you built in the GPIO questions, a servo, a red LED, and
// a green LED. The system should prompt the user to enter a 4-digit code using the keypad. Upon
// entering the code, the system should compare it with a code hardcoded in your application. If the
// entered code matches the hardcoded code, rotate the servo 90 degrees, then light up the green LED, indicating
// that the door is unlocked. Otherwise, if the entered code does not match the hardcoded code,
// the red LED should light up, indicating that the door is still locked.
#![no_std]
#![no_main]
use esp_backtrace as _;
use esp_hal::{
delay::Delay,
gpio::{Io, Level, Output},
prelude::*,
};
#[entry]
fn main() -> ! {
// Take the peripherals
let peripherals =
esp_hal::init(esp_hal::Config::default());
// Create a delay handle
let delay = Delay::new();
loop {
println!("Loop...");
delay.delay_ms(500u32);
}
}