From 4da8adf7dc4359db8ff92e47d5faafaf896fa13c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=85=89-k?= <36470587+kxgx@users.noreply.github.com> Date: Tue, 7 Jan 2025 21:42:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=A1=AC=E4=BB=B6=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E8=87=B3epd2in13=5FV4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/main.py b/bin/main.py index 14be405..d917eee 100644 --- a/bin/main.py +++ b/bin/main.py @@ -16,7 +16,7 @@ picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__) libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib') if os.path.exists(libdir): sys.path.append(libdir)#将引入文件添加到环境变量 - from waveshare_epd import epd2in13_V2 #引入墨水屏驱动文件 + from waveshare_epd import epd2in13_V4 #引入墨水屏驱动文件 logging.debug("Loading Fonts") font01 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 20) #字体文件 font02 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 15) #字体文件 @@ -30,7 +30,7 @@ def Local_strong_brush(): #局部强制刷新显示 while i < 5: epd.displayPartial(epd.getbuffer(info_image.rotate(180)))#局刷开始 i = i + 1 -def getWeath(city='101280601'): #天气函数,下载json天气至本地 +def getWeath(city='101060111'): #天气函数,下载json天气至本地 headers = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 Edg/94.0.992.50', 'Referer':'http://www.weather.com.cn/' @@ -235,7 +235,7 @@ def Partial_refresh():#局刷函数 try: ##################屏幕初始化######################### getWeath()#天气获取函数开始运行 - epd = epd2in13_V2.EPD() #初始化 + epd = epd2in13_V4.EPD() #初始化 epd.init(epd.FULL_UPDATE)#设定屏幕刷新模式 epd.Clear(0xFF) #清除屏幕内容 ##################屏幕初始化######################### @@ -254,5 +254,5 @@ except KeyboardInterrupt: logging.info("ctrl + c:") epd.init(epd.FULL_UPDATE) epd.sleep() - epd2in13_V2.epdconfig.module_exit() + epd2in13_V4.epdconfig.module_exit() exit()