Describe the bug
You must read data from serial before writing again. I am using a Parallax Serial LCD, which doesn't send data, if this is a device-specific problem.
To Reproduce
Import this code.
serial.redirect(pins.TX, pins.RX, BaudRate.BaudRate2400)
let buf = pins.createBuffer(2)
buf.setNumber(NumberFormat.Int8LE, 0, 0x11) // Backlight on
buf.setNumber(NumberFormat.Int8LE, 1, 0x0c) // Form feed
serial.writeBuffer(buf)
loops.pause(5) // The display requires this after a form feed
serial.writeString("Test")
// Display shows "Te"
// serial.readString() // Workaround (uncomment this line)
// serial.writeString("Test") // Workaround (uncomment this line)
// Display shows "Test", not "TestTest"
Expected behavior
I expected the display to show "Test" and not have to run the last two lines.
Desktop (please complete the following information):
OS: macOS 10.15.6
Browser: Chrome
Version: 85
Note: I'm sorry if this belongs in microsoft/pxt - let me know and I'll make it there
Describe the bug You must read data from serial before writing again. I am using a Parallax Serial LCD, which doesn't send data, if this is a device-specific problem.
To Reproduce Import this code.
Expected behavior I expected the display to show "Test" and not have to run the last two lines.
Desktop (please complete the following information):
Note: I'm sorry if this belongs in microsoft/pxt - let me know and I'll make it there