基于单片机交通灯系统仿真设计-全套资料
【资源下载】下载地址如下1424:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl
#include <REGX51.H>
#define uchar unsigned char
sbit NSgreen = P3^1; //南北人行道绿灯
sbit WEgreen = P3^0; //东西人行道绿灯
sbit Add_Button = P3^5;//加时间按键
sbit Sub_Button = P3^4;//减时间按键
sbit Reduces_Button = P3^3;//模式选择按键
sbit Y1 = P3^2;
sbit WEbuy_Button = P3^6 ;
sbit NSbuy_Button = P3^7 ;
uchar qiehuan=0;
uchar red = 33,yellow = 3,green_strant = 30,green_left = 30;
uchar Mode = 0;
uchar KeyDown=0;
uchar DisplayTab[]={ 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x79}; // 0 1 2 3 4 5 6 7 8 9 E
uchar led[8];
uchar Display_Number[] = {0x82,0x84,0x28,0x48,0x81,0x84,0x18,0x48}; //路口红绿灯状态
//延时
void Delay_ms(unsigned int Cnt )
{