Add and update I2C topics (#602)
* Add and update I2C topics * Throw in some edits for the serial buffer apis * Add an example to serial read buffer
This commit is contained in:
committed by
Peli de Halleux
parent
f2f097a9ed
commit
985ad3d8e3
@ -1,4 +1,4 @@
|
||||
# Serial Write Buffer
|
||||
# write Buffer
|
||||
|
||||
Write a buffer to the [serial](/device/serial) port.
|
||||
|
||||
@ -6,6 +6,22 @@ Write a buffer to the [serial](/device/serial) port.
|
||||
serial.writeBuffer(pins.createBuffer(0));
|
||||
```
|
||||
|
||||
You place your data characters into an existing buffer. All of the data, the length of the buffer, is written to the serial port.
|
||||
|
||||
## Parameters
|
||||
|
||||
* `buffer` is the buffer to write to the serial port
|
||||
* **buffer**: a [buffer](/types/buffer) to write to the serial port.
|
||||
|
||||
## Example
|
||||
|
||||
Read some characters of data from a device connected to the I2C pins. Write the data to the serial port.
|
||||
|
||||
```blocks
|
||||
pins.i2cWriteNumber(132, NumberFormat.UInt8LE, 0);
|
||||
let i2cBuffer = pins.i2cReadBuffer(132, 16, false);
|
||||
serial.writeBuffer(i2cBuffer);
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
[read buffer](/reference/serial/read-buffer)
|
Reference in New Issue
Block a user