Skip to content

Instantly share code, notes, and snippets.

@cpuwolf
Last active October 27, 2025 11:42
Show Gist options
  • Select an option

  • Save cpuwolf/2f55c83ba53219688fce2b47be3ec787 to your computer and use it in GitHub Desktop.

Select an option

Save cpuwolf/2f55c83ba53219688fce2b47be3ec787 to your computer and use it in GitHub Desktop.
show system local data and time
-- *****************************************************************
-- created by Wei Shuai <[email protected]> 2025-10-21
-- *****************************************************************
if ilua_is_acfpath_excluded("jenny") or ilua_is_acfpath_excluded("curt") then
return
end
-- Do not remove below lines: hardware detection
local qmpe = com.sim.qm.Qmpe:new()
if not qmpe:Init() then
return
end
-- Do not remove above lines: hardware detection
uluaLog("QMPE of jenny")
function datetimenowqmpe()
-- local formattedDate = os.date("%Y-%m-%d %H:%M:%S")
local formattedYear = os.date("%y%m%d")
local formattedDate = os.date("%H%M%S")
local act = tonumber(formattedYear)
local stby = tonumber(formattedDate)
uluaSet(idr_qmpe_hid_vhf1a_int, act)
uluaSet(idr_qmpe_hid_vhf1a_mode, 1)
uluaSet(idr_qmpe_hid_vhf1s_int, stby)
uluaSet(idr_qmpe_hid_vhf1s_mode, 1)
end
function halloweencountdown()
local time1 = os.time()
local time2 = os.time({ year = 2025, month = 10, day = 31, hour = 0, min = 0, sec = 0 })
-- Calculate the difference in seconds
local total_seconds = os.difftime(time2, time1)
uluaLog("Time difference in seconds:", total_seconds)
-- Convert to other units (e.g., minutes, hours)
local days = math.floor(total_seconds / 86400)
local remaining = total_seconds % 86400
local hours = math.floor(remaining / 3600)
remaining = remaining % 3600
local minutes = math.floor(remaining / 60)
local seconds = math.floor(remaining % 60)
formattedYear = string.format("%03d%03d", days, hours)
formattedDate = string.format("%03d%03d", minutes, seconds)
local act = tonumber(formattedYear)
local stby = tonumber(formattedDate)
uluaSet(idr_qmpe_hid_vhf2a_int, act)
uluaSet(idr_qmpe_hid_vhf2a_mode, 1)
uluaSet(idr_qmpe_hid_vhf2s_int, stby)
uluaSet(idr_qmpe_hid_vhf2s_mode, 1)
end
x = 0
function blinkqmpe()
local b = 5
local TIM2_PERIOD = 40
local y
y = (b * x) - ((b * b * x * x) / (4 * TIM2_PERIOD));
x = x + 1
x = x % ((4 * TIM2_PERIOD) / b);
uluaSet(idr_qmpe_hid_bright_int, y)
end
uluasetInterval("blinkqmpe()", 100)
uluasetInterval("datetimenowqmpe()", 200)
uluasetInterval("halloweencountdown()", 1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment