New Serial extension Serial Read String

Microsoft's MakeCode platform for easy blocks-style programming

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
crcibernetica
 
Posts: 58
Joined: Fri Apr 11, 2014 6:59 pm

New Serial extension Serial Read String

Post by crcibernetica »

Last night the MakeCode App for Microsoft updated and now we have the Serial Extension!
The Serial Write functions are working (115200 bps output on A7 (TX)).
However, the "Serial Read String" function does not seem to be working. Here is the test code:

Code: Select all

forever(function () {
    console.log(serial.readString())
})
Sending data from a terminal to the CPX doesn't show any data. I have tried different line endings (newline, CR, newline + CR).
Has anyone had luck with this function?
Last edited by crcibernetica on Thu Nov 22, 2018 11:27 am, edited 1 time in total.

User avatar
crcibernetica
 
Posts: 58
Joined: Fri Apr 11, 2014 6:59 pm

Re: New Serial extension Serial Read String

Post by crcibernetica »

Additional info:
The instant I send any data to the CPX it freezes up.

Code: Select all

forever(function () {
    if (serial.readString().length > 0) {
        console.log("Got something!")
    }
    console.log(".")
})

Locked
Please be positive and constructive with your questions and comments.

Return to “MakeCode”