hello,
i thought that i post this question a half hour aggo, but i can not find it back ?
no problem i asked again:
i want to send a bytearray over UART, but i'm not verry succesfull so far.
problem is, how to fill uart.write() ?
you can see in the first part of my posted code, how i fill the array.
the 2e part is how i want to send it.
how i want to do it now is "byte by byte" but I think this is not the right method
can anybody tell me how i have to do this ?
thanks in advance.
i thought that i post this question a half hour aggo, but i can not find it back ?
no problem i asked again:
i want to send a bytearray over UART, but i'm not verry succesfull so far.
problem is, how to fill uart.write() ?
you can see in the first part of my posted code, how i fill the array.
the 2e part is how i want to send it.
how i want to do it now is "byte by byte" but I think this is not the right method
can anybody tell me how i have to do this ?
thanks in advance.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
if scanner_uart. any (): # is anything comming from the scanner ? r15 = bytearray( 230 ) scanner_uart.readinto(r15) print ( "r15" ,[byte for byte in r15]) #************** SEND DATA TO 2E PIC0 ********************************** MAX485.value( 1 ) # 1 = write and 0 = read MAX485 for i in range ( 229 ): byte_to_send = r15 [i] scanner_uart.write(b '\byte_to_send' ) # time.sleep_ms ( 1 ) # print(r7[i]) MAX485.value( 0 ) # 1 = write and 0 = read MAX485 |
I'm not French, but from the netherlands