ex00 ok
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user