#include <reg52.h>
#include "delay.h"
#define LCDPORT P0
sbit RS = P2^4;
sbit RW = P2^5;
sbit E = P2^6;
#define LCD_WRITE_DATA 1
#define LCD_WRITE_COM 0
unsigned char hour = 0;
unsigned char min = 0;
unsigned char sec = 0;
unsigned char ch[9];
unsigned char flag = 0;
unsigned char alarm_hour = 21;
unsigned char alarm_min = 8;
unsigned char alarm_sec = 21;
sbit beep = P2^7;
void alarm()
{
if(alarm_hour == hour && alarm_min == min)
{
beep = ~beep;
}
}
void timer0_init(void)
{
EA = 1;
TMOD |=
单片机==lcd_串口修改数码管时间_闹钟(19)
最新推荐文章于 2023-09-16 08:32:27 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)