Skip to content

Add the magnetic rotary sensor driver and the rotating sea lion component - #75

Merged
AnakinRaW merged 7 commits into
mainfrom
claude/magnetic-rotary-driver-d6d748
Dec 5, 2026
Merged

AnakinRaW merged 7 commits into
mainfrom
claude/magnetic-rotary-driver-d6d748

Conversation

@AnakinRaW

Copy link
Copy Markdown
Owner

Summary

  • The magnetic rotary sensor driver reads the AS5600 on the sea lion rod through the I²C bus every driver tick. It adds up the steps between two readings and publishes ROTOR_MOVED and ROTOR_STOPPED. begin() reads whether the magnet sits at the right gap. A sensor missing at the start counts as failed at once, so the device monitor's first check reports it. The gist is deleted.
  • The rotating sea lion component turns each ROTOR_STOPPED whose movement reached the set angle into SEA_LION_SHOT, with the angle in whole degrees, positive clockwise seen from above. It counts full turns since reset(). A shot back takes a turn away and completes none.
  • The firmware begins the driver after the touch driver, and the device monitor watches it. The component joins the components the driver events are offered to.
  • The driver and component documents link their headers instead of copying the interface.

Tests

  • Computer: magnetic-rotary (9 tests) and rotating-sea-lion (5 tests), all 32 programs pass.
  • The release and debug firmware build, and so does the test image. tidy, clang-format, test-coverage and figcheck pass.
  • Waiting for hardware: reads and the rotary cases of every-driver on the Teensy; magnet, turns, dead-band, unplugged and missing-at-start on the bench; vibration and ball in the machine.

🤖 Generated with Claude Code

AnakinRaW and others added 7 commits November 30, 2026 19:31
The driver reads the AS5600 on the sea lion rod through the I²C bus every
driver tick. It adds up the steps between two readings and publishes
ROTOR_MOVED and ROTOR_STOPPED into the event queue. begin() reads whether
the magnet sits at the right gap. A sensor missing at the start counts as
failed at once, so the device monitor's first check reports it.

The computer tests run the driver on a fake I²C bus that holds the
AS5600's registers. The test image adds a Teensy test, the bench tests and
the driver's cases in every-driver. The driver document links the header,
and the gist is deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The component turns each ROTOR_STOPPED whose movement reached the set
angle into SEA_LION_SHOT, with the angle in whole degrees, positive
clockwise seen from above. It counts the full turns of all shots since
reset(). A shot completes a turn when it carries the sea lion a further
whole turn away from where it stood at reset(), so a shot back takes a
turn away and completes none. A movement that reset() comes into counts
for nothing.

The computer tests hand it driver events made up as the driver publishes
them. The component document links the header.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The main task begins the rotary sensor driver after the touch driver, and
the device monitor watches it also when begin() fails. The sea lion
component joins the components the driver events are offered to and
takes the sensor's first position where the game host's begin() stands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
reads requires the magnet in front of the sensor, since without one the
driver reports nothing and a resting rod passed unseen. missing-at-start
requires the sensor to answer before the cable is pulled, so a Teensy
without a sensor no longer passes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The driver reads the magnet once in begin(), so a test that needs the
magnet asks the person to set it and restarts the Teensy into its resume
half. reads skips without the sensor or the magnet, and magnet passes
whenever the AS5600 reports it neither too weak nor too strong. The
runner no longer counts the time a person takes to answer an ASK line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The magnet model gives that window for the magnet at hand, so the
Seeed wiki's 0.5 to 3 mm goes. Any gap the AS5600 accepts works, and
the mount needs no adjustment toward a centered gain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sea lion joins the game host: main.cpp adds it as a component, the
Machine carries it as a field for the games, and the host resets it at
every game switch. The firmware, the simulator, the test image and the
game host's computer tests build their Machine with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AnakinRaW
AnakinRaW merged commit 8570310 into main Dec 5, 2026
14 checks passed
@AnakinRaW
AnakinRaW deleted the claude/magnetic-rotary-driver-d6d748 branch December 5, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant