From 3e68db14bb02a964dc87b902623a7d873d5c2fa3 Mon Sep 17 00:00:00 2001 From: Savanni D'Gerinel Date: Tue, 16 Aug 2022 17:24:48 -0400 Subject: [PATCH] Minor adjustments to the lantern program --- lantern-controller/main.c | 3 +++ lantern/main.c | 10 +++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lantern-controller/main.c b/lantern-controller/main.c index 32688e2..e91f38c 100644 --- a/lantern-controller/main.c +++ b/lantern-controller/main.c @@ -30,6 +30,9 @@ int main(void) { EIMSK = 1 << INT2; EICRA |= 1 << ISC21 | 1 << ISC20; + dio_t int2 = { .ddr = &DDRD, .port = &PORTD, .pin = &PIND, .addr = 2 }; + dio_set_direction(&int2, LINE_IN); + rfm_t radio = (rfm_t){ .spi = { .clock = { .ddr = &DDRB, .port = &PORTB, .pin = &PINB, .addr = 1 }, diff --git a/lantern/main.c b/lantern/main.c index 1711db2..3dd0f71 100644 --- a/lantern/main.c +++ b/lantern/main.c @@ -98,22 +98,20 @@ int main(void) { { .brightness = 0, .r = 0, .g = 0, .b = 0 }, { .brightness = 0, .r = 0, .g = 0, .b = 0 }, }; - /* rgb_t error_indicator[LIGHT_COUNT] = { { .brightness = 1, .r = 255, .g = 0, .b = 0 }, { .brightness = 0, .r = 0, .g = 0, .b = 0 }, { .brightness = 0, .r = 0, .g = 0, .b = 0 }, + { .brightness = 1, .r = 255, .g = 0, .b = 0 }, { .brightness = 0, .r = 0, .g = 0, .b = 0 }, { .brightness = 0, .r = 0, .g = 0, .b = 0 }, - { .brightness = 0, .r = 0, .g = 0, .b = 0 }, - { .brightness = 0, .r = 0, .g = 0, .b = 0 }, + { .brightness = 1, .r = 255, .g = 0, .b = 0 }, { .brightness = 0, .r = 0, .g = 0, .b = 0 }, { .brightness = 0, .r = 0, .g = 0, .b = 0 }, }; - */ sk9822_send(&lights, off, LIGHT_COUNT); - _delay_ms(500); + _delay_ms(1000); lantern_t lantern = lantern_new(lights); lantern_set_mode(&lantern, normal); @@ -148,11 +146,9 @@ int main(void) { lantern_set_mode(&lantern, spooky); } else if (length == strlen("eerie") + 1 && !strncmp(msg, "eerie", length)) { lantern_set_mode(&lantern, eerie); - /* } else { sk9822_send(&lights, error_indicator, LIGHT_COUNT); _delay_ms(500); - */ } flags = rfm_interrupts(&radio); }