Add rpi-pico pin mapping and breadboard visuals - #412
Open
David Campey (campey) wants to merge 3 commits into
Open
Add rpi-pico pin mapping and breadboard visuals#412David Campey (campey) wants to merge 3 commits into
David Campey (campey) wants to merge 3 commits into
Conversation
Replaces the placeholder Pico SVG with the real board outline, maps GP0-GP28 to physical pin positions, and adds the onboard LED so the breadboard renders correctly in the simulator. Closes microsoft#380 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M81GUeXSjSFLBG5VCos7zn
Renaming the fixedInstance identifiers would break any previously saved Blocks-mode Pico project that references the old P-prefixed pin names, since the Blocks editor resolves pin dropdowns by symbol name, not a compat alias. Using block="GPn" keeps the underlying identifier (and JavaScript output) as Pn while the block picker and dropdown show GPn to match the board silkscreen. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M81GUeXSjSFLBG5VCos7zn
Without a gpioPinMap entry, the sim's pin-coordinate lookup can't resolve the board's fixedInstance LED pin, logging 'Unable to find coord for pin: LED' on every load. Every other board with an onboard LED self-maps it the same way (e.g. adafruit-feather-m4-express). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M81GUeXSjSFLBG5VCos7zn
Author
|
@microsoft-github-policy-service agree company="coderlevelup.org" |
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
Replaces the placeholder Pico SVG (a plain green rectangle with no pin mapping) with the real board outline, full GP0–GP28 pin mapping, and onboard LED, so the breadboard and pin dropdowns actually work for the RP2040 board.
Closes #380
What's included
board.json,board.svg): real Pico outline traced from the official Raspberry Pi SVG, with GP0–GP28, ground, power, and debug pins positioned to match the physical board, plus the onboard LED. Board is laid out to match the pinout orientation printed on the physical board's silkscreen.GPnlabels in the block picker (device.d.ts): the pin dropdown and block picker now showGP0–GP28to match the board's silkscreen, while the underlying identifier (and generated JavaScript) staysP0–P28. This is deliberate — renaming thefixedInstanceidentifiers themselves would break any previously saved Blocks-mode Pico project, since Blocks resolves pin dropdowns by symbol name, not a compat alias.Testing
pxt buildtargetpasses clean.Known limitation (pre-existing, not introduced by this PR)
Writing directly to the board's
LEDpin (e.g.pins.LED.digitalWrite(true)) logsUnable to find coord for pin: LEDin the simulator console. This isn't Pico-specific — it reproduces identically on Adafruit Feather M4 Express — so it's a pre-existing limitation in how the simulator's part allocator resolves a board's dedicated LED pin (as opposed to a regular GPIO pin), unrelated to this board'sboard.json/device.d.ts. Flagging for visibility; happy to open a separate issue if useful.