Browse Source

add light auto mode screen view

master
DESKTOP-B25GA9E\W35 1 year ago
parent
commit
e1d86067b9
  1. 2
      GPIO.lua
  2. 9
      OLED_SSD1306.lua

2
GPIO.lua

@ -37,6 +37,7 @@ function GPIOOn(gpioId)
end end
if gpioId == 10 then if gpioId == 10 then
Is_AutoClose = true; Is_AutoClose = true;
PageLight(LightArr);
end end
end end
--Push gpio to low --Push gpio to low
@ -57,6 +58,7 @@ function GPIOOff(gpioId)
end end
if gpioId == 10 then if gpioId == 10 then
Is_AutoClose = false; Is_AutoClose = false;
PageLight(LightArr);
end end
end end

9
OLED_SSD1306.lua

@ -53,6 +53,15 @@ function DrawLight(lightArr)
Disp:drawDisc(16*index,56,4,u8g2.U8G2_DRAW_ALL); Disp:drawDisc(16*index,56,4,u8g2.U8G2_DRAW_ALL);
end end
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 end
function PageMainScene(wifiName,ipAddress,version) function PageMainScene(wifiName,ipAddress,version)

Loading…
Cancel
Save