1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-12-22 18:34:25 +01:00

Added support for Kitchen Doorlight

This commit is contained in:
Ralf Ramsauer 2015-05-20 15:31:13 +02:00
parent 4d61754fc1
commit 0a87796c60

View File

@ -14,6 +14,9 @@
#define RED_ON (PORTB &= ~(1<<PB0)) #define RED_ON (PORTB &= ~(1<<PB0))
#define RED_OFF (PORTB |= (1<<PB0)) #define RED_OFF (PORTB |= (1<<PB0))
#define DOORLIGHT_ON (PORTD &= ~(1<<PD6))
#define DOORLIGHT_OFF (PORTD |= (1<<PD6))
#define OPEN_BOLZEN (PORTD &= ~(1<<PD4)) #define OPEN_BOLZEN (PORTD &= ~(1<<PD4))
#define CLOSE_BOLZEN (PORTD |= (1<<PD4)) #define CLOSE_BOLZEN (PORTD |= (1<<PD4))
@ -23,9 +26,6 @@
#define IS_RESCUE (!(PIND & (1<<PD3))) #define IS_RESCUE (!(PIND & (1<<PD3)))
#define IS_SWITCH (!(PIND & (1<<PD2))) #define IS_SWITCH (!(PIND & (1<<PD2)))
#define DE_RX (PORTD &= ~(1<<PD2))
#define DE_TX (PORTD |= (1<<PD2))
#define IS_SCK (!(PINB & (1<<PB7))) #define IS_SCK (!(PINB & (1<<PB7)))
uint8_t open = 0; uint8_t open = 0;
@ -35,6 +35,7 @@ void open_door()
RED_OFF; RED_OFF;
GREEN_ON; GREEN_ON;
OPEN_BOLZEN; OPEN_BOLZEN;
DOORLIGHT_ON;
_delay_ms(200); _delay_ms(200);
} }
@ -53,9 +54,9 @@ void close_door()
{ {
RED_ON; RED_ON;
GREEN_OFF; GREEN_OFF;
DOORLIGHT_OFF;
CLOSE_SCHNAPPER; CLOSE_SCHNAPPER;
CLOSE_BOLZEN; CLOSE_BOLZEN;
RED_ON;
} }
uint8_t klacker = 0; uint8_t klacker = 0;
@ -77,8 +78,8 @@ int main(void) {
// disable all interrupts // disable all interrupts
cli(); cli();
// PD5, PD4 Output // PD5, PD4, PD6 Output
DDRD = (1<<PD5)|(1<<PD4); DDRD = (1<<PD5)|(1<<PD4)|(1<<PD6);
DDRB = (1<<PB0)|(1<<PB1); DDRB = (1<<PB0)|(1<<PB1);
PORTB |= (1<<PB7)|(1<<PB5); PORTB |= (1<<PB7)|(1<<PB5);
@ -101,6 +102,7 @@ int main(void) {
CLOSE_SCHNAPPER; CLOSE_SCHNAPPER;
GREEN_OFF; GREEN_OFF;
RED_ON; RED_ON;
DOORLIGHT_OFF;
_delay_ms(1000); _delay_ms(1000);