单片机交通灯C语言设计(附带电路图).docVIP

  • 4
  • 0
  • 约2.7千字
  • 约 10页
  • 2018-05-03 发布于河南
  • 举报

单片机交通灯C语言设计(附带电路图).doc

单片机交通灯C语言设计(附带电路图)

#includereg51.h #define uchar unsigned char #define uint unsigned int uchar code seg7[10]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,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 sbit S1=P3^0; sbit S2=P3^1; sbit S3=P3^2; sbit S4=P3^3; //Delay function void Delay(uchar ms) { uchar j; while(ms--) for(j=0;j120;j++); } //east and west leds control f

文档评论(0)

1亿VIP精品文档

相关文档