diff --git a/src/beep.rs b/src/beep.rs
new file mode 100644
index 0000000..e295ccd
--- /dev/null
+++ b/src/beep.rs
@@ -0,0 +1,108 @@
+use embedded_svc::timer::{PeriodicTimer, TimerService};
+use esp_idf_hal::gpio::{Gpio4, Output};
+use esp_idf_hal::ledc::{config::TimerConfig, Channel, Timer};
+use esp_idf_hal::ledc::{CHANNEL0, TIMER0};
+use esp_idf_hal::prelude::*;
+use esp_idf_svc::timer::{EspTimer, EspTimerService};
+use esp_idf_sys::EspError;
+use log::{info, warn};
+use std::sync::{Arc, Mutex};
+use std::time::Duration;
+type LedcChannel
= Channel, P>;
+
+#[derive(Clone, Copy, Debug)]
+struct BeepState {
+ beat: u8,
+ ringtone: ringtone::Type,
+}
+
+impl BeepState {
+ pub fn new() -> Self {
+ Self {
+ beat: 0,
+ ringtone: ringtone::SILENCE,
+ }
+ }
+ pub fn from_ringtone(ringtone: ringtone::Type) -> Self {
+ Self { beat: 0, ringtone }
+ }
+}
+
+pub struct Beep {
+ watch_timer: Option,
+ state: BeepState,
+}
+impl Beep {
+ pub fn new() -> Self {
+ return Beep {
+ watch_timer: None,
+ state: BeepState::new(),
+ };
+ }
+ fn init_channel(
+ pin: Gpio4