Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <avr/io.h>
- #include <string.h>
- void uart_putc(char data)
- {
- //Wait until the transmitter is ready
- while(!(UCSRA & (1<<UDRE)))
- {
- //Do nothing
- }
- //Now write the data to USART buffer
- UDR=data;
- }
- void uart_puts(const char *text)
- {
- for (int i = 0; i < strlen(text); i++)
- {
- uart_putc(text[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement