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

Serial.writeLine sometimes does not work as expected #127

Open
Pascal-Flores opened this issue Jun 2, 2023 · 0 comments
Open

Serial.writeLine sometimes does not work as expected #127

Pascal-Flores opened this issue Jun 2, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Pascal-Flores
Copy link
Collaborator

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

@Pascal-Flores Pascal-Flores added the bug Something isn't working label Jun 2, 2023
@Pascal-Flores Pascal-Flores self-assigned this Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant