Clarify DCMotor sample pin numbering and H-bridge wiring#2583
Merged
Conversation
Copilot
AI
changed the title
[WIP] Improve clarity on DCMotor example for H Bridge connections
Clarify DCMotor sample pin numbering and H-bridge wiring
Jul 1, 2026
raffaeler
approved these changes
Jul 1, 2026
raffaeler
approved these changes
Jul 1, 2026
Contributor
|
I approved, but don´t know this piece of hardware. |
Contributor
There was a problem hiding this comment.
Pull request overview
Clarifies the DCMotor sample’s GPIO numbering scheme and documents how the DCMotor.Create(6, 27, 22) arguments map to typical H-bridge control inputs, so readers can wire hardware to match the sample.
Changes:
- Added BCM/GPIO numbering guidance and a pin-to-H-bridge mapping comment in the sample program.
- Added a new Wiring section in the DCMotor README with a mapping table and wiring notes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/devices/DCMotor/samples/Program.cs | Adds comments explaining BCM numbering and the 3-pin wiring mapping. |
| src/devices/DCMotor/README.md | Adds a Wiring section with BCM numbering guidance, mapping table, and wiring checklist. |
raffaeler
approved these changes
Jul 23, 2026
krwq
approved these changes
Jul 23, 2026
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.
The DCMotor sample uses
DCMotor.Create(6, 27, 22)but never documents that these are BCM (logical) GPIO numbers, nor which argument maps to which H-bridge input — making it impossible to wire the H-bridge to match the code. The maintainer confirmed the pins are BCM numbering.Documentation/comment-only change; no motor control logic touched.
Changes
README.md: Added a Wiring section stating pins use BCM numbering (with a link to the Raspberry Pi pinout), plus a table mapping eachCreateargument to its BCM pin and H-bridge input, and the remaining wiring notes as a bullet list. Kept the embedded code block in sync with the sample.samples/Program.cs: Added comments noting BCM numbering and the pin→H-bridge mapping, pointing to the README.Pin mapping (3-pin mode)
CreateargumentspeedControlPindirectionPinotherDirectionPinNote: the Fritzing diagram (
dcmotor_bb.png) was not regenerated; the docs now explicitly state the numbering scheme so the code and diagram can be reconciled by a reviewer with the hardware.