标题:
一个单片机串行接口的简单小程序
[打印本页]
作者:
oldspring
时间:
2018-10-18 11:20
标题:
一个单片机串行接口的简单小程序
char uart_rd;
void main() {
UART1_Init(4800); // Initialize UART module at 4800 bps
Delay_ms(100); // Wait for UART module to stabilize
UART1_Write_Text("Start");
while (1) { // Endless loop
if (UART1_Data_Ready()) { // If data is received,
uart_rd = UART1_Read(); // read the received data,
UART1_Write(uart_rd); // and send data via UART
}
}
}
复制代码
相关信息:
http://www.51hei.com/bbs/dpj-136722-1.html
UART Example.jpg
(67.93 KB, 下载次数: 33)
下载附件
2018-10-18 11:19 上传
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1