单片机中串口显示数字1至10

2019-04-15 18:53发布

#include #include "delay.h" #include void uart_init() { SCON = 0x50; TMOD |= 0x20; TH1 = 0xfd; TR1 = 1; } void uart_send_byte(unsigned char byte) { SBUF = byte; while(!TI); TI = 0; //ÊÖ¶¯Çå0 } void uart_send_str(unsigned char *s) { while((*s) != '