summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2025-07-25 11:12:27 +0800
committerSadeep Madurange <sadeep@asciimx.com>2025-07-25 11:12:27 +0800
commit1029ccacba1885bd76c14349288c5e6c81258598 (patch)
treefb5aa740d56a48269cdc9e19566a53e30b4dcab4
parent8ec701c2117d9e07678c393d98b74414ad112837 (diff)
downloadfpm-door-lock-1029ccacba1885bd76c14349288c5e6c81258598.tar.gz
Revert "wip: move the servo incrementally."
This reverts commit 8ec701c2117d9e07678c393d98b74414ad112837.
-rw-r--r--main.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/main.c b/main.c
index fc43684..326f4ac 100644
--- a/main.c
+++ b/main.c
@@ -13,7 +13,6 @@
#define PWM_MID 1600
#define PWM_MAX 2550
#define PWM_TOP 19999
-#define PWM_DELTA 50
#define LED_PIN PB5
#define LED_DDR DDRB
@@ -55,22 +54,14 @@ static volatile enum CTRL cmd = NONE;
static inline void lock(void)
{
- int pwm;
-
- for (pwm = PWM_MID + PWM_DELTA; pwm < PWM_MAX; pwm += PWM_DELTA) {
- OCR1A = pwm;
- _delay_ms(50);
- }
+ OCR1A = PWM_MID;
+ _delay_ms(500);
}
static inline void unlock(void)
{
- int pwm;
-
- for (pwm = PWM_MAX - PWM_DELTA; pwm > PWM_MID; pwm -= PWM_DELTA) {
- OCR1A = pwm;
- _delay_ms(50);
- }
+ OCR1A = PWM_MAX;
+ _delay_ms(500);
}
static inline void flash_led(void)