Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --This program will include the APIs to
- --control doors using a touch screen
- --and to display the status of the keycard
- controlSide = "left"
- displaySide = "right"
- controlMonitor = peripheral.wrap(controlSide)
- displayMonitor = peripheral.wrap(displaySide)
- cx,cy = controlMonitor.getSize()
- dx,dy = displayMonitor.getSize()
- --create the display monitor bg
- function displaybg(mode)
- ebgcolor = colors.lightGray
- ebdcolor = colors.gray
- gbgcolor = colors.lime
- gbdcolor = colors.green
- rbgcolor = colors.pink
- rbdcolor = colors.red
- bgc = colors.black
- bdc = colors.gray
- txc = colors.white
- txt = " "
- if mode == "good" then
- bgc = colors.lime
- bdc = colors.green
- txc = colors.black
- txt = "GOOD"
- else if mode == "deny"
- bgc = colors.pink
- bdc = colors.red
- txc = colors.black
- txt = "DENY"
- else
- bgc = colors.lightGray
- bdc = colors.gray
- txc = colors.white
- txt = "EMPTY"
- end
- displayMonitor.setBackgroundColor(bdc)
- displayMonitor.clear()
- displayMonitor.setCursorPos(2,3)
- displayMonitor.setTextColor(txc)
- displayMonitor.write(txt)
- displayMonitor.setBackgroundColor(bgc)
- for i=0,dx,1 do
- displayMonitor.setCursorPos(i+1,1)
- displayMonitor.write(" ")
- end
- for i=0,dx,1 do
- displayMonitor.setCursorPos(i+1,dy)
- displayMonitor.write(" ")
- end
- for i=0,dy,1 do
- displayMonitor.setCursorPos(1,i+1)
- displayMonitor.write(" ")
- end
- for i=0,dy,1 do
- displayMonitor.setCursorPos(dx,i+1)
- displayMonitor.write(" ")
- end
- displayMonitor.setBackgroundColor(colors.black)
- displayMonitor.setTextColor(colors.white)
- end
- displaybg()
Add Comment
Please, Sign In to add comment