Advertisement
Guest User

Untitled

a guest
Nov 24th, 2011
3
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <avr/io.h>
  2. #include <string.h>
  3.  
  4. void uart_putc(char data)
  5. {
  6. //Wait until the transmitter is ready
  7.  
  8. while(!(UCSRA & (1<<UDRE)))
  9. {
  10. //Do nothing
  11. }
  12.  
  13. //Now write the data to USART buffer
  14.  
  15. UDR=data;
  16. }
  17.  
  18. void uart_puts(const char *text)
  19. {
  20. for (int i = 0; i < strlen(text); i++)
  21. {
  22. uart_putc(text[i]);
  23. }
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement