From 70a03df8e376b0a097a28633d6516bbb8daa7f60 Mon Sep 17 00:00:00 2001 From: itzmarkoni Date: Tue, 5 May 2026 18:29:33 -0400 Subject: [PATCH] debug: scan all peripherals to find GPU name --- programs/roulette.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/programs/roulette.lua b/programs/roulette.lua index 4798cbb..58b2715 100644 --- a/programs/roulette.lua +++ b/programs/roulette.lua @@ -20,7 +20,21 @@ local tris = { { 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, } -local gpu = peripheral.wrap("tm_gpu_0") +print("Scanning peripherals...") +for _, name in ipairs(peripheral.getNames()) do + print(name .. " = " .. peripheral.getType(name)) +end + +local gpu +for _, name in ipairs(peripheral.getNames()) do + local t = peripheral.getType(name) + if t and t:find("gpu") then + gpu = peripheral.wrap(name) + print("Found GPU: " .. name) + break + end +end +if not gpu then error("No GPU peripheral found.") end gpu.refreshSize() gpu.setSize(64) local pw, ph, bx, by, sb = gpu.getSize()