缘由求老哥帮做一下单片机题。_嵌入式-CSDN问答
#include "REG52.h"
bit k=1;
void main()
{
unsigned char Xd=0,ss=15,cs=0;
unsigned int ys=64000;
while(1)
{
P1=ss;
if(++ys==0&&cs<8)
{
k=~k;
++cs;
ss=(k?15:240);
ys=64000;
}
}
}
#include "REG52.h"
bit k=1;
void main()
{
unsigned char Xd=0,ss=0,cs=0;
unsigned int ys=64000;
while(1)
{
P1=ss;
if(++ys==0)
{
++ss;
ys=64000;
}
}
}
#include "REG52.h"
bit k=1;
void main()
{
unsigned char Xd=0,ss=1,cs=0;
unsigned int ys=64000;
while(1)
{
P1=ss;
if(++ys==0)
{
ss+=cs++;
ys=64000;
}
}
}