Commit Graph
15 Commits
Author SHA1 Message Date
jessikitty b2016565f7 Restart hub scans that find nothing
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.
2026-09-15 23:08:38 +10:00
jessikitty 0c149272bd Smoother arms, and swap head tilt/turn ports
- 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.
2026-09-11 12:34:56 +10:00
jessikitty 343544510f Position-controlled arms
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.
2026-09-10 21:31:30 +10:00
jessikitty f5e7517cbd Evolved control scheme
- 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.
2026-09-10 16:20:44 +10:00
jessikitty 8fac5c893e Record the working configuration
- Pin the toolchain versions, with the Legoino/core 3.x error text.
- Note DIR_* direction constants and the corrected control table.
- Add the swapped-hub-address story to step 4, and the Arduino
  prototype-ordering trap to the gotchas list.
2026-09-10 11:40:34 +10:00
jessikitty 39bc43a878 Working configuration - verified on hardware
- 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.
2026-09-10 11:39:37 +10:00
jessikitty 6c476afb08 Document power options and the power-loss failsafe gap
Adds bench vs model power arrangements, the both-USB-plus-5V-jumper
hazard, current budget, diode drop margin, and a deliberate test for the
case the 400ms failsafe cannot cover.
2026-09-09 19:35:08 +10:00
jessikitty 9dd74d9d60 Rewrite as a step-by-step build guide for the Johnny 5 setup
Adds bring-up order (pair the pad before wiring, verify the port map with
DEBUG_MOTORS before trusting it), the tank drive control table, the extended
link protocol, and the wiring failure modes.
2026-09-09 19:30:18 +10:00
jessikitty 0b32384578 Rewrite receiver for all 7 Johnny 5 motors with tank drive
- 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.
2026-09-09 19:29:12 +10:00
jessikitty 6622dbd05c Send d-pad and analog triggers in the link frame
Johnny 5 needs seven axes of control, so the frame now carries dpad and
both analog triggers alongside the sticks and button mask.
2026-09-09 19:28:17 +10:00
jessikitty 24f4dcc08b Document architecture, setup and known gotchas 2026-08-27 19:33:26 +10:00
jessikitty 9ca087836c Add BLE scanner sketch for finding hub addresses 2026-08-27 19:32:50 +10:00
jessikitty fe7960a00e Add Legoino receiver sketch for two Powered Up hubs 2026-08-27 19:32:36 +10:00
jessikitty 6ef199814b Add Bluepad32 PS4 transmitter sketch 2026-08-27 19:32:02 +10:00
jessikitty 5e6cdd8a49 Initial commit 2026-08-27 19:31:33 +10:00