Repository navigation
Add the magnetic rotary sensor driver and the rotating sea lion component - #75
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ROTOR_MOVEDandROTOR_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.ROTOR_STOPPEDwhose movement reached the set angle intoSEA_LION_SHOT, with the angle in whole degrees, positive clockwise seen from above. It counts full turns sincereset(). A shot back takes a turn away and completes none.Tests
magnetic-rotary(9 tests) androtating-sea-lion(5 tests), all 32 programs pass.readsand the rotary cases ofevery-driveron the Teensy;magnet,turns,dead-band,unpluggedandmissing-at-starton the bench;vibrationandballin the machine.🤖 Generated with Claude Code