Skip to content

Commit

Permalink
0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
217heidai committed Nov 24, 2023
1 parent ad3c254 commit 45ffe23
Show file tree
Hide file tree
Showing 24 changed files with 8,841 additions and 11,006 deletions.
Binary file removed .DS_Store
Binary file not shown.
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
基于4.2寸三色墨水屏及ESP8266实现的天气日历。心血来潮,咸鱼上捡了一块墨水屏,参考了一些大佬的代码,写了一个天气日历。

## 展示
![workday](https://raw.githubusercontent.com/217heidai/eInkCalendar/main/doc/workday.jpeg)
![holiday](https://raw.githubusercontent.com/217heidai/eInkCalendar/main/doc/holiday.jpeg)
![battery](https://raw.githubusercontent.com/217heidai/eInkCalendar/main/doc/battery.jpeg)
![daily1](https://raw.githubusercontent.com/217heidai/eInkCalendar/main/doc/daily1.png)
![daily2](https://raw.githubusercontent.com/217heidai/eInkCalendar/main/doc/daily2.png)

## 功能
1. 日历信息展示,包括日期、星期、农历、节假日;
1. 日历信息展示,包括日期、星期、农历、宜忌、节假日;
2. 节假日信息展示,红色字体突出显示;
3. 天气信息展示,包括天气、最低温度、最高温度、紫外线
3. 天气信息展示,包括天气、最低温度、最高温度、体感舒适度
4. “一言”信息展示;
5. 为了省电,每次执行完任务后,深度休眠 60 分钟(具体见代码中 `SLEEP_TIME` 定义);
6.8 小时(具体见代码中 `REFRESH_FREQUENCY` 定义)联网刷新一次日期、天气信息。如日期发生变化,则强制刷新。
5. 为了省电,每次联网刷新后,深度休眠 XX 分钟(具体见代码中 `SLEEP_TIME` 定义);
6.X 小时(具体见代码中 `REFRESH_FREQUENCY` 定义)联网刷新一次日期、天气信息。如日期发生变化,则强制刷新。

## 计划
1. 翻页展示更多功能...
Expand All @@ -28,12 +27,16 @@
4. ArduinoJson
### 配置修改
1. `eInkCalendar.ino`中修改 WiFi 信息,设置 `ssid``password`;
2. `eInkCalendar.ino`中修改心知天气 API KEY 信息,设置 `url_FutureWeather``url_LifeIndex`;
3. `eInkCalendar.ino`中修改位置信息,支持到城市级别,设置 `url_FutureWeather``url_LifeIndex`
2. `eInkCalendar.ino`中修改天气链接中 location 信息为当地城市名称拼音(首字母大写,如上海 `Shanghai`),设置 `url_Weather`;

## 更新日志
### 0.0.4【2023/11/24】
1. 界面调整,增加横线分割;
2. 更换农历、天气、一言获取服务;
3. 增加农历宜忌。

### 0.0.3【2021/12/15】
1. 增加电量显示,绘制电池图标
1. 增加电量显示,绘制电池图标

### 0.0.2【2021/12/08】
1. 参考`甘草酸不酸`大佬的源码,修复了 `U8g2_for_Adafruit_GFX` 库崩溃问题,源码详见 lib 目录;
Expand Down
Binary file removed doc/.DS_Store
Binary file not shown.
Binary file removed doc/battery.jpeg
Binary file not shown.
Binary file added doc/daily1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/daily2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/holiday.jpeg
Binary file not shown.
Binary file removed doc/workday.jpeg
Binary file not shown.
Binary file removed lib/.DS_Store
Binary file not shown.
202 changes: 140 additions & 62 deletions src/GxEPD2_display_selection_new_style.h

Large diffs are not rendered by default.

47 changes: 42 additions & 5 deletions src/GxEPD2_selection_check.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,62 +13,99 @@
// Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0
// Good Display ePaper for Arduino: https://forum.arduino.cc/index.php?topic=436411.0

#define GxEPD2_102_IS_BW true
#define GxEPD2_150_BN_IS_BW true
#define GxEPD2_154_IS_BW true
#define GxEPD2_154_D67_IS_BW true
#define GxEPD2_154_T8_IS_BW true
#define GxEPD2_154_M09_IS_BW true
#define GxEPD2_154_M10_IS_BW true
#define GxEPD2_154_GDEY0154D67_IS_BW true
#define GxEPD2_213_IS_BW true
#define GxEPD2_213_B72_IS_BW true
#define GxEPD2_213_B73_IS_BW true
#define GxEPD2_213_B74_IS_BW true
#define GxEPD2_213_flex_IS_BW true
#define GxEPD2_213_M21_IS_BW true
#define GxEPD2_213_T5D_IS_BW true
#define GxEPD2_213_BN_IS_BW true
#define GxEPD2_213_GDEY0213B74_IS_BW true
#define GxEPD2_260_IS_BW true
#define GxEPD2_260_M01_IS_BW true
#define GxEPD2_266_BN_IS_BW true
#define GxEPD2_266_GDEY0266T90_IS_BW true
#define GxEPD2_270_IS_BW true
#define GxEPD2_270_GDEY027T91_IS_BW true
#define GxEPD2_290_IS_BW true
#define GxEPD2_290_T5_IS_BW true
#define GxEPD2_290_T5D_IS_BW true
#define GxEPD2_290_I6FD_IS_BW true
#define GxEPD2_290_T94_IS_BW true
#define GxEPD2_290_T94_V2_IS_BW true
#define GxEPD2_290_BS_IS_BW true
#define GxEPD2_290_M06_IS_BW true
#define GxEPD2_260_IS_BW true
#define GxEPD2_260_M01_IS_BW true
#define GxEPD2_270_IS_BW true
#define GxEPD2_290_GDEY029T94_IS_BW true
#define GxEPD2_371_IS_BW true
#define GxEPD2_370_TC1_IS_BW true
#define GxEPD2_420_IS_BW true
#define GxEPD2_420_M01_IS_BW true
#define GxEPD2_420_GDEY042T81_IS_BW true
#define GxEPD2_426_GDEQ0426T82_IS_BW true
#define GxEPD2_583_IS_BW true
#define GxEPD2_583_T8_IS_BW true
#define GxEPD2_583_GDEQ0583T31_IS_BW true
#define GxEPD2_750_IS_BW true
#define GxEPD2_750_T7_IS_BW true
#define GxEPD2_750_YT7_IS_BW true
#define GxEPD2_1160_T91_IS_BW true
#define GxEPD2_1248_IS_BW true
#define GxEPD2_it60_IS_BW true
#define GxEPD2_it60_1448x1072_IS_BW true
#define GxEPD2_it78_1872x1404_IS_BW true
#define GxEPD2_it103_1872x1404_IS_BW true
// 3-color e-papers
#define GxEPD2_154c_IS_3C true
#define GxEPD2_154_Z90c_IS_3C true
#define GxEPD2_213c_IS_3C true
#define GxEPD2_213_Z19c_IS_3C true
#define GxEPD2_213_Z98c_IS_3C true
#define GxEPD2_266c_IS_3C true
#define GxEPD2_270c_IS_3C true
#define GxEPD2_290c_IS_3C true
#define GxEPD2_290_Z13c_IS_3C true
#define GxEPD2_290_C90c_IS_3C true
#define GxEPD2_270c_IS_3C true
#define GxEPD2_420c_IS_3C true
#define GxEPD2_420c_Z21_IS_3C true
#define GxEPD2_583c_IS_3C true
#define GxEPD2_583c_Z83_IS_3C true
#define GxEPD2_750c_IS_3C true
#define GxEPD2_750c_Z08_IS_3C true
#define GxEPD2_750c_Z90_IS_3C true
#define GxEPD2_1248_IS_3C true
#define GxEPD2_1248c_IS_3C true
// 4-color e-paper
#define GxEPD2_266c_GDEY0266F51H_IS_4C true
#define GxEPD2_290c_GDEY029F51H_IS_4C true
#define GxEPD2_300c_IS_4C true
#define GxEPD2_420c_GDEY0420F51_IS_4C true
#define GxEPD2_437c_IS_4C true
// 7-color e-paper
#define GxEPD2_565c_IS_7C true
#define GxEPD2_730c_GDEY073D46_IS_7C true

#if defined(GxEPD2_DISPLAY_CLASS) && defined(GxEPD2_DRIVER_CLASS)
#define IS_GxEPD2_DRIVER(c, x) (c##x)
#define IS_GxEPD2_DRIVER_BW(x) IS_GxEPD2_DRIVER(x, _IS_BW)
#define IS_GxEPD2_DRIVER_3C(x) IS_GxEPD2_DRIVER(x, _IS_3C)
#define IS_GxEPD2_DRIVER_4C(x) IS_GxEPD2_DRIVER(x, _IS_4C)
#define IS_GxEPD2_DRIVER_7C(x) IS_GxEPD2_DRIVER(x, _IS_7C)
#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_3C(GxEPD2_DRIVER_CLASS)
#error "GxEPD2_BW used with 3-color driver class"
#endif
#if IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_BW(GxEPD2_DRIVER_CLASS)
#error "GxEPD2_3C used with b/w driver class"
#endif
#if !IS_GxEPD2_DRIVER_BW(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_DRIVER_3C(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_DRIVER_4C(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_DRIVER_7C(GxEPD2_DRIVER_CLASS)
#error "neither BW nor 3C nor 4C nor 7C kind defined for driver class (error in GxEPD2_selection_check.h)"
#endif

#endif
1 change: 0 additions & 1 deletion src/bitmap.cpp

Large diffs are not rendered by default.

94 changes: 48 additions & 46 deletions src/bitmap.h
Original file line number Diff line number Diff line change
@@ -1,50 +1,52 @@
#ifndef _BITMAP_H_
#define _BITMAP_H_

extern const unsigned char Bitmap_xztq[];
extern const unsigned char Bitmap_qt[];
extern const unsigned char Bitmap_dy[];
extern const unsigned char Bitmap_yt[];
extern const unsigned char Bitmap_zheny[];
extern const unsigned char Bitmap_lzy[];
extern const unsigned char Bitmap_lzybbb[];
extern const unsigned char Bitmap_xy[];
extern const unsigned char Bitmap_zhongy[];
extern const unsigned char Bitmap_dayu[];
extern const unsigned char Bitmap_by[];
extern const unsigned char Bitmap_dby[];
extern const unsigned char Bitmap_tdby[];
extern const unsigned char Bitmap_dongy[];
extern const unsigned char Bitmap_yjx[];
extern const unsigned char Bitmap_zhenx[];
extern const unsigned char Bitmap_xx[];
extern const unsigned char Bitmap_zhongx[];
extern const unsigned char Bitmap_dx[];
extern const unsigned char Bitmap_bx[];
extern const unsigned char Bitmap_fc[];
extern const unsigned char Bitmap_ys[];
extern const unsigned char Bitmap_scb[];
extern const unsigned char Bitmap_w[];
extern const unsigned char Bitmap_m[];
extern const unsigned char Bitmap_f[];
extern const unsigned char Bitmap_jf[];
extern const unsigned char Bitmap_ljf[];
extern const unsigned char Bitmap_wz[];
extern const unsigned char Bitmap_qt_ws[];
extern const unsigned char Bitmap_yt_wz[];
extern const unsigned char Bitmap_dy_wz[];
extern const unsigned char Bitmap_zy_wz[];
extern const unsigned char Bitmap_zx_wz[];
extern const unsigned char Bitmap_weizhi[];
extern const unsigned char Bitmap_zhuangtai[];
extern const unsigned char Bitmap_gengxing[];
extern const unsigned char Bitmap_riqi[];
extern const unsigned char Bitmap_BAT_LOW[];
extern const unsigned char Bitmap_humidity[];
extern const unsigned char Bitmap_fx[];
extern const unsigned char Bitmap_rdfb[];
extern const unsigned char Bitmap_yt_ws[];
extern const unsigned char Bitmap_dy_ws[];
extern const unsigned char Bitmap_zy_ws[];
extern const unsigned char Bitmap_zx_ws[];
#include <avr/pgmspace.h>

extern const unsigned char Bitmap_xztq[] PROGMEM;
extern const unsigned char Bitmap_qt[] PROGMEM;
extern const unsigned char Bitmap_dy[] PROGMEM;
extern const unsigned char Bitmap_yt[] PROGMEM;
extern const unsigned char Bitmap_zheny[] PROGMEM;
extern const unsigned char Bitmap_lzy[] PROGMEM;
extern const unsigned char Bitmap_lzybbb[] PROGMEM;
extern const unsigned char Bitmap_xy[] PROGMEM;
extern const unsigned char Bitmap_zhongy[] PROGMEM;
extern const unsigned char Bitmap_dayu[] PROGMEM;
extern const unsigned char Bitmap_by[] PROGMEM;
extern const unsigned char Bitmap_dby[] PROGMEM;
extern const unsigned char Bitmap_tdby[] PROGMEM;
extern const unsigned char Bitmap_dongy[] PROGMEM;
extern const unsigned char Bitmap_yjx[] PROGMEM;
extern const unsigned char Bitmap_zhenx[] PROGMEM;
extern const unsigned char Bitmap_xx[] PROGMEM;
extern const unsigned char Bitmap_zhongx[] PROGMEM;
extern const unsigned char Bitmap_dx[] PROGMEM;
extern const unsigned char Bitmap_bx[] PROGMEM;
extern const unsigned char Bitmap_fc[] PROGMEM;
extern const unsigned char Bitmap_ys[] PROGMEM;
extern const unsigned char Bitmap_scb[] PROGMEM;
extern const unsigned char Bitmap_w[] PROGMEM;
extern const unsigned char Bitmap_m[] PROGMEM;
extern const unsigned char Bitmap_f[] PROGMEM;
extern const unsigned char Bitmap_jf[] PROGMEM;
extern const unsigned char Bitmap_ljf[] PROGMEM;
extern const unsigned char Bitmap_wz[] PROGMEM;
extern const unsigned char Bitmap_qt_ws[] PROGMEM;
extern const unsigned char Bitmap_yt_wz[] PROGMEM;
extern const unsigned char Bitmap_dy_wz[] PROGMEM;
extern const unsigned char Bitmap_zy_wz[] PROGMEM;
extern const unsigned char Bitmap_zx_wz[] PROGMEM;
extern const unsigned char Bitmap_weizhi[] PROGMEM;
extern const unsigned char Bitmap_zhuangtai[] PROGMEM;
extern const unsigned char Bitmap_gengxing[] PROGMEM;
extern const unsigned char Bitmap_riqi[] PROGMEM;
extern const unsigned char Bitmap_BAT_LOW[] PROGMEM;
extern const unsigned char Bitmap_humidity[] PROGMEM;
extern const unsigned char Bitmap_fx[] PROGMEM;
extern const unsigned char Bitmap_rdfb[] PROGMEM;
extern const unsigned char Bitmap_yt_ws[] PROGMEM;
extern const unsigned char Bitmap_dy_ws[] PROGMEM;
extern const unsigned char Bitmap_zy_ws[] PROGMEM;
extern const unsigned char Bitmap_zx_ws[] PROGMEM;
#endif
Loading

0 comments on commit 45ffe23

Please sign in to comment.