mirror of
https://github.com/binary-kitchen/doorlockd
synced 2024-10-31 22:47:05 +01:00
Improved klackering mechanism for AC
This commit is contained in:
parent
156c02581b
commit
bebe258d7b
@ -47,14 +47,13 @@ void close_door()
|
||||
}
|
||||
|
||||
void schnapper(unsigned int i)
|
||||
{
|
||||
while(i--)
|
||||
{
|
||||
OPEN_SCHNAPPER;
|
||||
_delay_ms(125);
|
||||
CLOSE_SCHNAPPER;
|
||||
_delay_ms(125);
|
||||
while (i--) {
|
||||
_delay_ms(1000);
|
||||
}
|
||||
CLOSE_SCHNAPPER;
|
||||
_delay_ms(100);
|
||||
}
|
||||
|
||||
ISR(USI_OVERFLOW_vect)
|
||||
@ -118,7 +117,7 @@ int main(void) {
|
||||
open_door();
|
||||
if (klacker == 1)
|
||||
{
|
||||
schnapper(20);
|
||||
schnapper(3);
|
||||
klacker = 0;
|
||||
}
|
||||
}
|
||||
@ -126,16 +125,14 @@ int main(void) {
|
||||
if (IS_RESCUE) {
|
||||
cli();
|
||||
open_door();
|
||||
schnapper(30);
|
||||
_delay_ms(2000);
|
||||
schnapper(3);
|
||||
sei();
|
||||
} else if (IS_SWITCH && open == 0) {
|
||||
_delay_ms(300);
|
||||
if(IS_SWITCH && open == 0) {
|
||||
cli();
|
||||
open_door();
|
||||
schnapper(20);
|
||||
_delay_ms(3000);
|
||||
schnapper(5);
|
||||
sei();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user