개발모듈/펌웨어 모듈

- [AVR Studio 4] printf 함수 사용하기

메가아재 2019. 6. 9. 17:14
반응형
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdlib.h>
#include <stdio.h>
 
void UartTx(char message) 
    while((UCSR1A & 0x20== 0); 
    UDR1 = message; 
    UCSR1A |= 0x20
}    
 
static int Putchar(char c, FILE *stream) { UartTx(c); return 0; }
    
fdevopen(Putchar, 0);
 
printf("Hello World~!\r\n");    
printf("Number -> %d\r\n", Number);
cs


반응형