mirror of
https://github.com/ptrks/avr-usart-printf.git
synced 2025-07-08 19:31:02 +03:00
Added initial files
This commit is contained in:
26
example.c
Normal file
26
example.c
Normal file
@ -0,0 +1,26 @@
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
#include <stdint.h>
|
||||
#include "usart_printf/usart_printf.h"
|
||||
|
||||
#define FAULT_VCC_SHORT 3
|
||||
#define FAULT_GND_SHORT 2
|
||||
#define FAULT_OPEN_CONN 1
|
||||
#define NO_FAULT 0
|
||||
|
||||
int main(void) {
|
||||
|
||||
usart_initialize();
|
||||
stdout = &uart_output;
|
||||
_delay_ms(10);
|
||||
|
||||
for(;;) {
|
||||
|
||||
printf("Hello AVR printf");
|
||||
_delay_ms(1000);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user