Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local seg1 = "left"
- local seg2 = "bottom"
- local seg3 = "back"
- local seg4 = "right"
- local time_is = ""
- local at
- local bt
- local ct
- local dt
- print("loading API")
- shell.run("delete caAPI")
- shell.run("pastebin get EDLdR1nF caAPI")
- os.loadAPI("caAPI")
- local ix = true
- while ix == true do
- print("loading time")
- time_is = caAPI.getTime()
- print(time_is)
- print("split time")
- length = #time_is
- if length == 4 then
- at = "0"
- bt = string.sub(time_is,1,1)
- ct = string.sub(time_is,3,3)
- dt = string.sub(time_is,4,4)
- else
- at = string.sub(time_is,1,1)
- bt = string.sub(time_is,2,2)
- ct = string.sub(time_is,4,4)
- dt = string.sub(time_is,5,5)
- end
- print(at)
- print(bt)
- print(ct)
- print(dt)
- print("decode to 7 seg bundledCable")
- color_at = caAPI.numToSegCol(at)
- color_bt = caAPI.numToSegCol(bt)
- color_ct = caAPI.numToSegCol(ct)
- color_dt = caAPI.numToSegCol(dt)
- print("set Time on Display")
- if at == "0" then
- rs.setBundledOutput(seg4,colors.black)
- else
- rs.setBundledOutput(seg4,color_at)
- end
- rs.setBundledOutput(seg3,color_bt)
- rs.setBundledOutput(seg2,color_ct)
- rs.setBundledOutput(seg1,color_dt)
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement