定时控制路灯开关.docVIP

  • 12
  • 0
  • 约6.73千字
  • 约 13页
  • 2017-12-22 发布于河南
  • 举报
定时控制路灯开关

定时控制路灯开关 /****************************************************************************** 程序说明:利用DS1602 和 51 制作一个小时钟 作者:wdc 版本:v10.701 ******************************************************************************/ #include reg51.h //11.0592MHZ 定时器累加18次,为1s (仿真时:12MHZ, 定时器20次,正好为1s) #define uchar unsigned char #define uint unsigned int sbit rs=P2^4; //定义液晶三个控制口 sbit rw=P2^5; sbit en=P2^6; sbit s1=P3^0; //定义三个开关 sbit s2=P3^1; sbit s3=P3^2; sbit led=P3^6; sbit BEEP=P3^7; uchar count=0; //用于记录中断的次数,20次为1s uchar num=0; //记录按键1已经被按了的次数 uchar shi,f

文档评论(0)

1亿VIP精品文档

相关文档