From e1d86067b9b62bb8e800c1b0a62994ef69477f00 Mon Sep 17 00:00:00 2001 From: "DESKTOP-B25GA9E\\W35" <1733709035@qq.com> Date: Wed, 20 Sep 2023 17:30:53 +0800 Subject: [PATCH] add light auto mode screen view --- GPIO.lua | 2 ++ OLED_SSD1306.lua | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/GPIO.lua b/GPIO.lua index 1170f87..0c22073 100644 --- a/GPIO.lua +++ b/GPIO.lua @@ -37,6 +37,7 @@ function GPIOOn(gpioId) end if gpioId == 10 then Is_AutoClose = true; + PageLight(LightArr); end end --Push gpio to low @@ -57,6 +58,7 @@ function GPIOOff(gpioId) end if gpioId == 10 then Is_AutoClose = false; + PageLight(LightArr); end end diff --git a/OLED_SSD1306.lua b/OLED_SSD1306.lua index ffcbe80..176868a 100644 --- a/OLED_SSD1306.lua +++ b/OLED_SSD1306.lua @@ -53,6 +53,15 @@ function DrawLight(lightArr) Disp:drawDisc(16*index,56,4,u8g2.U8G2_DRAW_ALL); end end + if Is_AutoClose ~= nil then + if Is_AutoClose then + Disp:setFont(u8g2.font_6x10_tf); + Disp:drawStr(84,64,"Auto"); + else + Disp:setFont(u8g2.font_6x10_tf); + Disp:drawStr(84,64,"Manual"); + end + end end function PageMainScene(wifiName,ipAddress,version)