基于单片机声控光控路灯控制仿真设计

1468下载地址 https://docs.qq.com/doc/DWEpnR2pOWU91b3p4?pub=1&dver=2.1.0

 

#include <reg52.h>
#include <intrins.h> 
#define uchar  unsigned char
#define uint   unsigned int
#define ulong  unsigned long 
//共阳极数码管段码
uchar code SEG7[]={/*0,1,2,3,4,5,6,7,8,9,*/
0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,};
//数码管显示缓冲
uchar num[8];
//数码管位码端口
sbit      q2=P2^0;
sbit      q1=P2^1;
//延时函数ms
void _delay_ms(uint t)
{
   uint i,j;
   for(i=0;i<t;i++)
     for(j=0;j<120;j++);
}
//延时函数us
void _delay_us(uchar t)

 

 

 

posted @ 2021-03-16 16:30  roadroad  阅读(282)  评论(0编辑  收藏  举报
电设屋
上千套电子毕设课设方案