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

Update radio-broadcast examples in reference pages #6122

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

ganicke
Copy link
Collaborator

@ganicke ganicke commented Mar 17, 2025

Update radio-broadcast examples in reference pages.

  • Add inherited pages for radio-broadcast from pxt-common-packages.
  • Update pages from ./libs/radio-broadcast even though they're obsolete.

Note: Despite using unique enums for the message names, the decompile and render into blocks on the document seems to always set it back to message1. The examples work fine in the editor context though.

enum RadioMessage {
    message1 = 49434,
    Hello = 49337,
    Goodbye = 16885
}
input.onButtonPressed(Button.A, function () {
    radio.sendMessage(RadioMessage.Hello)
})
radio.onReceivedMessage(RadioMessage.Hello, function () {
    basic.showIcon(IconNames.Heart)
})
input.onButtonPressed(Button.B, function () {
    radio.sendMessage(RadioMessage.Goodbye)
})
radio.onReceivedMessage(RadioMessage.Goodbye, function () {
    basic.showIcon(IconNames.Scissors)
})

Closes #6115

@ganicke ganicke requested review from abchatra and Jaqster March 17, 2025 18:34
@abchatra abchatra merged commit 41110f9 into master Mar 17, 2025
7 checks passed
@abchatra abchatra deleted the radio-send-msg-example branch March 17, 2025 18:44
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.

Radio Broadcast docs - sample code incorrect
2 participants