This commit is contained in:
hugo LAMY
2025-03-10 10:19:42 +01:00
parent 7459a2155c
commit 73bb93d96f
3 changed files with 38 additions and 20 deletions

View File

@@ -1,20 +1,32 @@
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h> // https://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html
#include <avr/interrupt.h>
#include "utils.h"
#include "bitmanip.h"
#include "timer.h"
#include "usart.h"
#include "interrupt.h"
// ask for username and password
int main() {
uart_init();
ask_for_username();
SREG |= ENABLE_GLOBAL_INTERRUPT; // 7.3.1 : Status Register, bit 7 : I Global Interrupt Enable
while(1);
void rgb_d5_roll_colors() {
MODE_OUTPUT(RGB5_RED);
MODE_OUTPUT(RGB5_GEEN);
MODE_OUTPUT(RGB5_BLUE);
while(1) {
SET_ELEM(RGB5_RED);
_delay_ms(1000);
CLEAR_ELEM(RGB5_RED);
SET_ELEM(RGB5_GEEN);
_delay_ms(1000);
CLEAR_ELEM(RGB5_GEEN);
SET_ELEM(RGB5_BLUE);
_delay_ms(1000);
CLEAR_ELEM(RGB5_BLUE);
}
}
// led RGB D5 must turns on in red then green then blue in a loop
int main() {
while(1) {
rgb_d5_roll_colors();
}
}