USB0.sendbyte(byte, <timeout>)

This command sends a byte to the first mini USB port USB0.

The first input parameter byte can be zero or any Python byte to send to the first mini USB port USB0.

The second input parameter <timeout> is optional and is a Python integer, measured in 1/10s. It represents the maximum time to wait for the byte to be sent to the first mini USB port USB0 when buffer is full and further data is blocked. The timeout range is (0 ÷ 32767).

This method returns immediately after the byte has been sent to the first mini USB port USB0 or after the timeout period if the byte could not be sent to the first mini USB port USB0. The return value is a Python integer which is -1 if the timeout period has expired, 1 otherwise.

 

Example:

 

b = USB0.sendbyte(0x0d)

 

sends the byte 0x0d, that corresponds to <CR>, to the first mini USB port USB0 handling, assigning the return value to b.