Description: Get the number of bytes (characters) of the received value
Parameter:
write:()
Description: When it is in host state, the host will add the data to be sent to the sending queue; when it is in the slave state, the slave will
send the data to the requesting host.
Parameter:
valuc: send as a single byte
string: send as a series of bytes
data: an array to send as a series of bytes
requestFrom(address,quantity)
Description: The host sends a data request signal to the slave. After using requestfrom(), the slave can use onrequest() to register an event
to respond to the host's request. The host can read the data through the available() and read() functions.
Parameter:
quantity: the number of bytes to request
address:ddress of the device to request bytes from
beginTransmission(address)
Description: Begin a transmission to the slave device with the given address. Subsequently, queue bytes for transmission with the write()
function and transmit them by calling endTransmission().
Parameter:
address: address of the device to transmit to
endTransmission
Description: Ends a transmission
Parameter: