Minor adjustments to the lantern program

This commit is contained in:
Savanni D'Gerinel 2022-08-16 17:24:48 -04:00
parent 966ef20eca
commit 3e68db14bb
2 changed files with 6 additions and 7 deletions

View File

@ -30,6 +30,9 @@ int main(void) {
EIMSK = 1 << INT2; EIMSK = 1 << INT2;
EICRA |= 1 << ISC21 | 1 << ISC20; 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){ rfm_t radio = (rfm_t){
.spi = { .spi = {
.clock = { .ddr = &DDRB, .port = &PORTB, .pin = &PINB, .addr = 1 }, .clock = { .ddr = &DDRB, .port = &PORTB, .pin = &PINB, .addr = 1 },

View File

@ -98,22 +98,20 @@ int main(void) {
{ .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 },
}; };
/*
rgb_t error_indicator[LIGHT_COUNT] = { rgb_t error_indicator[LIGHT_COUNT] = {
{ .brightness = 1, .r = 255, .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 },
{ .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 }, { .brightness = 0, .r = 0, .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); sk9822_send(&lights, off, LIGHT_COUNT);
_delay_ms(500); _delay_ms(1000);
lantern_t lantern = lantern_new(lights); lantern_t lantern = lantern_new(lights);
lantern_set_mode(&lantern, normal); lantern_set_mode(&lantern, normal);
@ -148,11 +146,9 @@ int main(void) {
lantern_set_mode(&lantern, spooky); lantern_set_mode(&lantern, spooky);
} else if (length == strlen("eerie") + 1 && !strncmp(msg, "eerie", length)) { } else if (length == strlen("eerie") + 1 && !strncmp(msg, "eerie", length)) {
lantern_set_mode(&lantern, eerie); lantern_set_mode(&lantern, eerie);
/*
} else { } else {
sk9822_send(&lights, error_indicator, LIGHT_COUNT); sk9822_send(&lights, error_indicator, LIGHT_COUNT);
_delay_ms(500); _delay_ms(500);
*/
} }
flags = rfm_interrupts(&radio); flags = rfm_interrupts(&radio);
} }