rhubarbdog/microbit-radio

Null character padding difficulty

brahmafear opened this issue · 1 comments

When receiving a string from MakeCode (either via the send string block or the send value block), the string returned by parse() contains a bunch of null bytes that interfere with the normal display.show() method (they show as ?).

Suggest this change in line 127:
From
return message

To:
return message.rstrip('\x00')

Now fixed thanks for spotting that my test program was doing
data=radio.recievePacket()
display.scroll(str(data))
which was stripping the 0 bytes