Work: Ledfanexe

local THRESH = 80 -- °C local FLASH_MS = 200

while true do local t = get_temp() if t >= THRESH then alert() else set_speed(40) -- normal operation set_color(0,255,0) -- green when cool end sleep(500) -- poll twice per second end Run it with: ledfanexe work

ledfanexe.exe -script heat-alert.lua -- music-sync.lua local sensitivity = 0.6 -- tweak to your environment local THRESH = 80 -- °C local FLASH_MS

function alert() set_speed(100) -- full speed set_color(255,0,0) -- solid red sleep(FLASH_MS) set_color(0,0,0) -- off (or any other colour) sleep(FLASH_MS) end 0) -- solid red sleep(FLASH_MS) set_color(0

To see the full list, run ledfanexe.exe -anim list . The Lua engine gives you the most flexibility. A script is just a plain text file ending in .lua . The following API is exposed by ledfanexe :