Skip to content

Serial.writeLine sometimes does not work as expected #127

Description

@Pascal-Flores

Describe the bug
When an STM32 is connected via USB to Makecode and sending data with the function Serial.writeLine, sometimes nothing appears on the Makecode console.

code that sometimes does not display anything :

input.buttonD2.onEvent(ButtonEvent.Down, function () {
		Serial.writeLine("Reaction time" + (control.millis() - timeTurnOn) + " ms");
    newGame()
})
function newGame () {
    pins.D4.digitalWrite(false)
    pause(randint(1000, 5000))
    timeTurnOn = control.millis()
    pins.D4.digitalWrite(true)
}
let timeTurnOn = 0
Serial.attachToConsole()
newGame()

TODO : check the code to see difference between Serial.writeLine and Serial.writeValue

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions