#include<pic.h> #include<string.h> void pic_init(void) { TRISC7=1; TRISC6=0; } void uart_init(void) { TXSTA=0x20; RCSTA=0x90; SPBRG=15; } void tx(unsigned char byte) { int i; TXREG=byte; while(!TXIF); for(i=0;i<400;i++); } void string_uart(char *q) { while(*q) { *(*q++); } } unsigned char rx() { while(!RCIF); return RCREG; } void main() { //char *q; pic_init(); uart_init(); tx('N'); rx(); string_uart("test program"); }
Quote:void string_uart(char *q) { while(*q) { *(*q++); }
void string_uart(char *q) { while(*q) { tx((unsigned char) *q); ++q; } }
void string_uart(char *q) { while(*q) { tx(*q++); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)