汇编交通灯程序,使灯循环亮!
![](http://uphotos.eepw.com.cn/larrybird/thumb/avatar.jpg)
1楼
很多实验参考上面都有的,你参照一下吧~!
![](http://uphotos.eepw.com.cn/fellow119/thumb/avatar.jpg)
2楼
关键是延时,
![](http://uphotos.eepw.com.cn/halibote/thumb/avatar.jpg)
3楼
延时的控制就行
![](http://uphotos.eepw.com.cn/zhaochunliang/thumb/avatar.jpg)
4楼
画好程序流程图,。。。 也可以参考 别人的程序
![](http://uphotos.eepw.com.cn/jianzhangx/thumb/avatar.jpg)
5楼
给你个51才程序 /* 名称:LED模拟交通灯 说明:东西向绿灯亮若干秒,黄灯闪烁5次后红灯亮, 红灯亮后,南北向由红灯变为绿灯,若干秒后南北向黄灯闪烁5此后变红灯,东西向变绿灯,如此重复。 */ #include #define uchar unsigned char #define uint unsigned int sbit RED_A=P0^0; //东西向灯 sbit YELLOW_A=P0^1; sbit GREEN_A=P0^2; sbit RED_B=P0^3; //南北向灯 sbit YELLOW_B=P0^4; sbit GREEN_B=P0^5; uchar Flash_Count=0,Operation_Type=1; //闪烁次数,操作类型变量 //延时 void DelayMS(uint x) { uchar i; while(x--) for(i=0;i
![](http://uphotos.eepw.com.cn/1659255477/thumb/avatar.jpg)
6楼
很多参考程序
![](http://uphotos.eepw.com.cn/1659255477/thumb/avatar.jpg)
7楼
时序控制好,延时控制好
最新人才