main.c
来自「单片机编程语言 51单片机读写U盘例程 U盘作为数据的载体目前已广泛应用于嵌入」· C语言 代码 · 共 50 行
C
50 行
#include <reg52.h>
#include "Uart.h"
/*
函数:Delay()
功能:延时0.001~65.536s
参数:
t>0时,延时(t*0.001)s
t=0时,延时65.536s
说明:
晶振采用11.0592MHz
使用之前,应当把T0设置成模式1,即16位定时器模式
*/
void Delay(unsigned int t)
{
do
{
TH0 = 0xFC;
TL0 = 0x66+17;
TR0 = 1;
while ( !TF0 );
TF0 = 0;
TR0 = 0;
} while ( --t != 0 );
}
uint8 temp[]="ZLGMCU.COM";
void main()
{ TMOD = 0x01;
UartInit(9600L);
Delay(100);
UartSendString("Hello!\r\n");
UartInit(57600L);
UartSendString("Hello!57600\r\n");
SendResponse(temp,10);
UartSendString("Hello!57600\r\n");
/*
UartSendString("Hello!\r\n");
UartInit(57600L);
UartSendString("Hello!57600\r\n");
SendS("ZLGMCU.COM",10);
*/
for (;;);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?