what is the best way to write an int array to uart? I've never used python, maybe my conversion from int[] to string is wrong:
Code: Select all
array = [42, 86, 127]
buf = ''
for i in array:
buf += chr(i)
uart.write(buf)
ok, i solved it like this:
Code: Select all
array = [42, 86, 127]
byte_array = bytearray(array)
uart.write(byte_array)
Code: Select all
sleep_ms(100)
rxData = bytes()
while uart.any() > 0:
rxData += uart.read(1)
print(rxData)