- 4
- 0
- 约2.7千字
- 约 10页
- 2018-05-03 发布于河南
- 举报
单片机交通灯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
您可能关注的文档
最近下载
- 有限单元法原理及应用.pptx VIP
- 22K311-5 防排烟系统设备及部件选用与安装.docx
- 《建筑材料(第4版)》教学课件-第6章 砌体材料.ppt VIP
- 监理项目部市政工程顶管施工监理细则.docx VIP
- 发动学生思维,小学数学教师课堂提问有效性探索.pdf VIP
- 砂石料供货运输服务方案.pdf VIP
- 南昌大学《软件工程》2020-2021学年期末试卷.docx VIP
- DB37T5330-2025非承重自保温砌块墙体系统应用技术标准(911.77KB).pdf VIP
- 高中历史选择性必修2知识点总结归纳-35页.pdf VIP
- Q ZJMKJ0003-2017_桥梁缆索防护用PVF胶带.pdf VIP
原创力文档

文档评论(0)