summaryrefslogtreecommitdiffstats
path: root/rf_test/send.c
diff options
context:
space:
mode:
Diffstat (limited to 'rf_test/send.c')
-rw-r--r--rf_test/send.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/rf_test/send.c b/rf_test/send.c
index 539cf79..dafac63 100644
--- a/rf_test/send.c
+++ b/rf_test/send.c
@@ -4,6 +4,7 @@
#include "rfm.h"
+#define LED_PIN PB1
#define LOCK_BTN PD6
#define UNLOCK_BTN PD7
@@ -17,6 +18,10 @@ static inline void lock(void)
data[0] = LOCK;
rfm_sendto(ADDR, data, 1);
+
+ PORTB |= (1 << LED_PIN);
+ _delay_ms(500);
+ PORTB &= ~(1 << LED_PIN);
}
static inline void unlock(void)
@@ -25,6 +30,10 @@ static inline void unlock(void)
data[0] = UNLOCK;
rfm_sendto(ADDR, data, 1);
+
+ PORTB |= (1 << LED_PIN);
+ _delay_ms(500);
+ PORTB &= ~(1 << LED_PIN);
}
static inline int is_btn_pressed(unsigned char btn)
@@ -48,6 +57,8 @@ int main(void)
DDRD &= ~((1 << LOCK_BTN) | (1 << UNLOCK_BTN));
PORTD |= (1 << LOCK_BTN) | (1 << UNLOCK_BTN);
+ DDRB |= (1 << LED_PIN);
+
rfm_init();
pcint2_init();