-- find the monitor and set it as main output local monitor = peripheral.find("monitor") term.redirect(monitor) local width, height = term.getSize() local center_x = (width / 2) + 1 local center_y = (height / 2) + 1 -- base cirlce image local circle_image = paintutils.parseImage([[ 8888888888 888888 888888 8888 8888 88 88 8888 8888 88 88 88 88 88 88 8888 8888 88 88 8888 8888 888888 888888 8888888888 ]]) local circle_width = 26 local circle_height = 13 -- draw sweep line local SWEEP_DELAY = 0.05 local SWEEP_AMOUNT = 18 local sweep_angle = 0 -- main loop local quit = false local function draw_loop() while not quit do sweep_angle = sweep_angle + SWEEP_AMOUNT term.setBackgroundColor(colors.black) term.clear() paintutils.drawImage(circle_image, center_x - (circle_width / 2) + 1, center_y - (circle_height / 2) + 1) local sweep_rad = math.rad(sweep_angle) local sweep_x = math.cos(sweep_rad) * circle_width / 2 local sweep_y = math.sin(sweep_rad) * circle_height / 2 paintutils.drawLine(center_x, center_y, sweep_x + center_x, sweep_y + center_y, colors.red) os.sleep(SWEEP_DELAY) end end local function quit_handler() while not quit do local _, key, _ = os.pullEvent("key") if keys.getName(key) == "q" then quit = true end end end parallel.waitForAny(draw_loop, quit_handler) -- reset color term.setBackgroundColor(colors.black) term.clear()