diff --git a/turtle.lua b/turtle.lua index a8b8284..8213095 100644 --- a/turtle.lua +++ b/turtle.lua @@ -54,15 +54,19 @@ print("ID: " .. os.getComputerID()) -- GPS Functions local function updatePosition() - local x, y, z = gps.locate(2) + print("Requesting GPS position...") + local x, y, z = gps.locate(10) -- Increased timeout to 10 seconds if x then state.position = {x = math.floor(x), y = math.floor(y), z = math.floor(z)} + print("GPS position: " .. x .. ", " .. y .. ", " .. z) return true end + print("GPS timeout - no position received") return false end local function setHome() + print("Setting home position...") if updatePosition() then state.homePosition = { x = state.position.x,