简单的51单片机编程题
发布网友
发布时间:2022-04-20 08:13
我来回答
共1个回答
热心网友
时间:2023-06-15 21:03
灞曞紑鍏ㄩ儴#include
#define uchar unsigned char
#define uint unsigned int
sbit LED = P1^0;
uchar T_Count = 0;
void main()
{
TMOD = 0x01;
TH0 = (65535-5000)/256;
TL0 = (65535-5000)%256;
IE = 0x82;
TR0 = 1;
while(1);
}
void LED_Flash() interrupt 1
{
TH0 = (65535-5000)/256;
TL0 = (65535-5000)%256;
if(++T_Count == 100)
{
LED = !LED;
T_Count = 0;
}
}