#include <DS3231.h>
#include <Wire.h>
#include <U8glib.h>
#include <DHT.h>
#include<EEPROM.h>
DHT dht;
U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE);
extern uint8_t SmallFont[];
int q[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
extern unsigned char TinyFont[];
char zidingyi[60] = "Copyright lxm. All rights reserved.";
DS3231 Clock;
bool Century = false, h12 = false, PM;
long ds, dd;
int n = 14, y = 10, r = 1, h = 0, m = 0, s = 0;
int second, minute, hour, date, month, year, temperature;
float humidity, temp;
char a[20];
void ReadDS3231()
{
second = Clock.getSecond();
minute = Clock.getMinute();
hour = Clock.getHour(h12, PM);
date = Clock.getDate();
month = Clock.getMonth(Century);
year = Clock.getYear();
temperature = Clock.getTemperature();
}
int runnian(int i)
{
if ((i % 400 == 0) || ((i % 4 == 0) &&
蓝牙时钟,自定义倒计时,自定义字符串
最新推荐文章于 2023-04-24 21:59:17 发布
这个博客介绍了如何使用蓝牙连接单片机,通过DS3231实时时钟模块获取时间,并实现自定义倒计时功能。程序中包含了读取DS3231数据、计算日期差、更新显示以及接收蓝牙指令来设置未来时间点的操作。同时还展示了如何用Arduino编程来处理这些功能。
摘要由CSDN通过智能技术生成