Skip to content

Documentation of serial blocks is not clear about newlines and doesn't mention the MakeCode console #6649

@martinwork

Description

@martinwork

Describe the bug

Arising from support ticket https://support.microbit.org/helpdesk/tickets/93700 (private)

Snippets from the opening email...

"the differences between serial write line, number, value, and string are a little confusing when trying to explain which one to use to kids"

""serial write number" does NOT work (when I click "Show data Device," it just says "Values will be logged when the device sends data")"

"Not sure if this is a bug or if I'm doing something wrong - here's a link to the simple program where I get the error message: https://makecode.microbit.org/_KH1Fxe24jRh1"

After realising that the MakeCode console is waiting for a newline, and investigating which blocks include one....

"The (lack of) newline was the missing puzzle piece for me. Perhaps that could be made clearer in some of the documentation? For example, the page for serial write line says that it starts a new line:

Serial Write Line

but the page for serial write number doesn't say that it DOESN'T start a new line:

Serial Write Number

and the example on that page doesn't really make it clear that it will keep printing on one line. I don't think many users (myself included) will understand that the default is to keep printing on the same line unless you explicitly call for a new line.

Similarly, this page that you linked doesn't say one way or the other which blocks start a new line and which ones don't:

Serial"

Expected behavior

Could https://makecode.microbit.org/device/serial mention the MakeCode console?

  • how the MakeCode console works with newlines
  • the Show data Device button doesn't appear until the device sends a newline
  • how write value and write numbers, or lines of CSV, relate to graphs
  • mention which blocks include a newline and why some don't

Could https://makecode.microbit.org/reference/serial make more of which blocks include a newline.

Example: one two three is not a generally good way to repeatedly write a number

Could the console message "Values will be logged when the device sends data" be changed to ",,, sends data with a newline"?

Should the simulator also wait for a newline?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions