Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Author: Gunny576
- Date: 4/26
- Coil Monitor System-Display
- Usage: This program will listen to the wireless network to display coil information to a monitor.
- --]]
- --configs
- coils = 8
- offeset=0
- --peripheral establisment for monitor and Modem.
- mon = peripheral.wrap("right")
- local modem = peripheral.wrap("left")
- --establishes our display array
- payload={}
- for i=1,coils do
- modem.open(i+offest)
- payload[i][1]=i
- payload[i][2]=0
- end
- modem.open(1)
- mon.clear()
- mon.setTextScale(2)
- a = 0
- b = 0
- while true do
- local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
- print(message[0].."% Cell "..message[1] )
- payload[senderChannel][2]=message[0]
- mon.clear()
- mon.setBackgroundColor(colors.black)
- for i=1,coils do
- mon.setCursorPos(1,i)
- mon.write("Coil "..payload[i][1].. " is at "..payload[i][2].."%")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement