单片机交通灯C语言设计程序

用单片机实现的交通灯设计

#include<reg51.h>

#define uchar unsigned char

#define uint unsigned int

uchar

,0x80,0x90};

uchar cs,second_counts;

uchar k;

uchar Flash_count=0,Operation_type=1;

//east and west leds

sbit RED_A=P2^0;

sbit YELLOW_A=P2^1;

sbit GREEN_A=P2^2;

//south and north leds

sbit RED_B=P2^3;

sbit YELLOW_B=P2^4;

sbit GREEN_B=P2^5;

//7segments control bits code seg7[10]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8

单片机交通灯C语言设计程序相关文档

最新文档

返回顶部