A Legoino scan that never locates its hub ends quietly - isConnecting()
never goes true, so the old code left 'initialised' set and never touched
retryAt. That hub then sat on a dead scan until the board was power
cycled, which is why first connects needed several attempts.
Adds scanExpiresAt per hub and restarts the scan after 12s. Also
documents the startup order and the LED grounding in the header.
- ARM_STEP_DEG 8 -> 3 and a dedicated ARM_MIN_GAP_MS of 60, so the arm
tracks the trigger instead of jumping between targets. Speed and spans
left as they were.
- hub1 port B is the tilt motor, C is the turn motor - swapped from what
the first build assumed.
- Zero the arm encoders once per boot rather than on every reconnect. The
hub keeps its preset, and re-zeroing mid-session would redefine zero at
whatever position the arms were in when the link dropped.
Trigger position now sets arm ANGLE rather than power, via
setAbsoluteMotorPosition with BrakingStyle::HOLD. Encoders are zeroed on
hub1 connect, so both arms must be down at that moment.
Spans measured with tools/arm_calibrate: roughly +280 left, -275 right,
both comfortably under one motor revolution so the absolute encoder is
unambiguous. Set to +/-250 to keep backlash clear of the end stop.
L3/R3 are no longer bound - releasing the trigger is lowering.
Also documents the async-init trap in serviceHub.
- Correct hub1 port map: A is the left arm, C is the head tilt.
- Arms: L2/R2 raise proportionally, L3/R3 lower at reduced power.
- Head turn onto L1/R1, head tilt onto d-pad left/right, body lift onto
d-pad up/down. All move while held.
- Square is now the panic stop; Cross toggles 50/100% track speed.
- Circle and Triangle toggle two GPIO LED circuits on pins 25 and 26.
- Latching controls are edge-detected; frames arrive at ~50Hz so a held
button would otherwise toggle continuously.
- Swap HUB0/HUB1 addresses; they were the wrong way round.
- Add DIR_* constants for all seven motors, with DIR_RIGHT_TRACK at -1.
- Swap the right arm buttons: Cross raises, Triangle lowers.
- Move struct Frame into the types block - the Arduino prototype
generator needs it declared above the first function definition.
- Pin core 2.0.17 in the header; 3.x will not build Legoino.
- Parse the extended frame (d-pad and analog triggers).
- Drive both hubs across all seven ports, one input per motor.
- Add a per-hub rate limit alongside the per-port one; hub1 has four
motors and the per-port throttle alone floods it.
- DEBUG_MOTORS flag to log which port each command lands on.