! { loop {} }\nuse physical_ai_hal::*;\n\n// control() runs every control period (like a timer interrupt). Right now it\n// only blinks the LED — the rover never moves. Make it drive to the goal pad.\nfn control(p: &mut Peripherals) {\n let dist = p.goal.distance(); // metres to the goal\n let _bearing = p.goal.bearing(); // radians, + = goal is to your LEFT\n p.led.set(dist > 0.2); // GPIO: status LED on while still driving\n\n // TODO: steer toward the goal (use _bearing) and drive forward.\n p.motors.set(0.0, 0.0);\n}\ncontrol_loop!(control);\n","task":{"goal":[1.2,1.2],"time":12.0,"tol":0.2},"title":"GPIO, Peripherals & the Control Loop"}">
PYTHON · NUMPY · IN-BROWSER

GPIO, Peripherals & the Control Loop

Write no_std embedded Rust against the rover HAL. It compiles to WASM and runs as the real control loop.