phetsims/paper-land

Send a string by default over microbit UART when program removed

brettfiedler opened this issue · 1 comments

When a Bluetooth component is added:

  • Start a UART service and write (microbit UART RX) onProgramRemoved code to send a string delimiter "#". Keep the starting and stopping delimiters for now. The whole message will read "$#|"

The MakeCode program will look for the "#" delimiter to act on the message sent when a program is removed.

No additional UI needed. Need to note its existence in the documentation, as well as the functions we added to abstract some of the data types for sending to and from the microbit.

OK, this is done. I tested in a simple case with a small change to the microbit code.

  1. When a BLE component is removed, we send a microbit specific UART message. It looks like this: $#45| where
  • $ is the start delimiter
  • # is the 'removal' delimiter
  • 45 is the number of the program removed (so this can be any number)
  • | is the end delimiter
  1. I added this bit in makecode to test it
    image

  2. Note this feature is specific to microbit UART RX.

@brettfiedler would you like to verify anything for this or are there any other changes needed here?