Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- ####--------------------------------####
- #--# Author: by uriid1 #--#
- #--# License: GNU GPLv3 #--#
- #--# Telegram: @main_moderator #--#
- #--# E-mail: appdurov@gmail.com #--#
- ####--------------------------------####
- --]]
- local path = '/sys/class/leds/'
- local led = {
- path..'green:power/brightness'; -- 1
- path..'green:wlan/brightness'; -- 2
- path..'green:lan4/brightness'; -- 3
- path..'green:lan3/brightness'; -- 4
- path..'green:lan2/brightness'; -- 5
- path..'green:lan1/brightness'; -- 6
- path..'green:wan/brightness'; -- 7
- path..'green:usb/brightness'; -- 8
- path..'green:qss/brightness'; -- 9
- }
- local function set_bright(led, val)
- local fd = io.open(led, 'w')
- fd:write(val)
- fd:close()
- end
- function sleep(a)
- local sec = os.clock() + a
- while os.clock() < sec do end
- end
- local function off_all_leds()
- for i = 1, #led do
- set_bright(led[i], 0)
- end
- end
- local function linear_activate_left(spd)
- for i = 1, #led do
- set_bright(led[i], 255)
- sleep(spd)
- end
- end
- local function linear_deactivate_left(spd)
- for i = #led, 1, -1 do
- set_bright(led[i], 0)
- sleep(spd)
- end
- end
- -- Main anim loop
- while true do
- off_all_leds()
- linear_activate_left(0.1)
- linear_deactivate_left(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement