Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new pin shadow blocks and field editor #5863

Merged
merged 1 commit into from
Aug 27, 2024
Merged

Conversation

riknoll
Copy link
Member

@riknoll riknoll commented Aug 26, 2024

Fixes #5733

This PR does a few things:

  1. Creates three new abbreviated shadow blocks that only say P0 instead of analog pin P0
  2. Changes the shadow block for the analog read block so that it only lists the analog-readable pins
  3. Adds a new field editor which displays a warning when a non-analog-readable pin is placed inside of the analog read block (see GIF below). This field editor is otherwise identical to the gridpicker
  4. Renames the pins.analogPin and pins.digitalPin functions so that they start with an underscore, which means they get filtered out of the TS intellisense
  5. Removes the (write only) text from the analog pin selector since the new field editor gives warnings instead

Here's what the warning looks like:

writeonly-pin

@sae220 FYI

@riknoll riknoll requested a review from a team August 26, 2024 22:54
@riknoll
Copy link
Member Author

riknoll commented Aug 26, 2024

oh also, this PR relies on microsoft/pxt#10118 but is safe to merge without it!

Copy link
Contributor

@srietkerk srietkerk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question for my learning, but otherwise looks good!

//% shim=TD_ID
//% blockId=digital_pin
//% block="digital pin $pin"
//% pin.fieldEditor=pinpicker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the field editor for the gridpicker had quotes around it, are the quotes not needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope! they don't hurt anything, i just like no quotes better

@riknoll riknoll merged commit 774a8cc into master Aug 27, 2024
7 checks passed
@riknoll riknoll deleted the dev/riknoll/pin-shadows branch August 27, 2024 15:06
@abchatra
Copy link
Collaborator

@carlosperate @jaustin please take a look at /beta and ensure all issues of pins are addressed as expected.

@martinwork
Copy link
Contributor

@abchatra @carlosperate @jaustin Please see new comments added to #5834

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.

Digital pin vs analog pin blocks
5 participants