#include <regx51.h>
sfr P0=0x80;
sfr p1=0x90;
sfr P2=0xa0;
sbit tt7=P2^7;
void delay_ms(char n)
{ char i,j;
for (j=n;j>0;j--)
{for (i=125;i>0;i--);}
}
main()
{char temp;
char ABC=0;
P0=0;P2=1;
while(1)
{
ABC=2;
P2=0xf0|ABC;
tt7 =0;
temp=P0;
tt7 =1;
delay_ms(100);
ABC=0;
P2=0xf0|ABC;
P0=temp;
tt7 =0;
delay_ms(100);
tt7 =1;
ABC=3;
P2=0xf0|ABC;
tt7 =0;
temp=P0;
tt7 =1;
delay_ms(100);
ABC=1;
P2=0xf0|ABC;
P0=temp;
tt7 =0;
delay_ms(100);
tt7 =1;
}
}
PLC.rar_74ls374c程序_plc 单片机_plc 单片机_单片机 PLC_单片机PLC
版权申诉
80 浏览量
2022-09-19
18:04:12
上传
评论
收藏 115KB RAR 举报
林当时
- 粉丝: 100
- 资源: 1万+