⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 51读写u盘 uart.c main.c rwudiskdemo.c
💻 C
字号:
#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -