Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Load the required components
- local ccb = peripheral.find("ccbridge") -- CC: C Bridge peripheral
- local monitor = peripheral.find("monitor") -- Monitor peripheral
- -- Function to display the line from target_block_0 on monitor_0
- function displayLine()
- -- Get the line from target_block_0
- local success, result = pcall(ccb.call, "target_block_0", "getLine")
- if success then
- -- Clear the monitor
- monitor.clear()
- -- Set cursor position at (1,1)
- monitor.setCursorPos(1, 1)
- -- Display the line on monitor
- monitor.write(result)
- else
- print("Failed to get line from target_block_0")
- end
- end
- -- Main function
- function main()
- while true do
- displayLine()
- sleep(1) -- Adjust the sleep time as needed
- end
- end
- -- Run the main function
- main()
Advertisement
Add Comment
Please, Sign In to add comment