51单片机
#include<absacc.h>#define PORTA XBYTE
#define CONTROL XBYTE
void delaylong(void);
void delayshort(void);
void main (void)
{
CONTROL=0x80;
PORTA=0x0c;
delaylong();
PORTA=0x0a;
delaylong();
PORTA=0x21;
delaylong();
PORTA=0x11;
delaylong();
}
void delaylong(void)
{
unsigned i;
for(i=0;i<60000;i++);
}
51单片机的交通灯仿真,C语言的,就是简单了点
页:
[1]