基于单片机汽车转向灯控制系统设计
1453下载地址 https://docs.qq.com/doc/DWEpnR2pOWU91b3p4?pub=1&dver=2.1.0
#include<reg52.h> #define uchar unsigned char #define uint unsigned int sbit S1=P1^0; sbit S2=P1^1; sbit L1=P1^4; sbit L2=P1^5; sbit R1=P1^6; sbit R2=P1^7; void delay(uint x) { int t; while(x--) for(t=0;t<125;t++); //延时1ms } void main() { P1=0X03; //0000 0011 while(1) { { if (S1==1&&S2==1) delay(10); if (S1==1&&S2==1) //消抖 { L1=1,L2=1,R1=1,R2=1; //双闪