Write data to the serial device
Simulink Support Package for Raspberry Pi Hardware / Communication
Write data to a serial device connected to the Raspberry Pi™ hardware. To open the pin map of the Raspberry Pi board, click the View pin map.
Refer to Asynchronous Serial Communication for information.
Port_1 — The input port to accept data
[Nx1] or [1xN] array
The input port through which the block accepts data.
Board — The specific board used for serial communication
Pi 2 Model B (default) |
Model B Rev1 |
Model B Rev2 |
Model B+ |
Pi 3 Model B
Select the specific board that you are using. Changing the board updates the pin choices that you get.
Port — The port at which you want to connect to the serial device
The port to which to you want to connect from the selected Raspberry Pi board to the serial device. For Pi 3 Model B board, the default serial port is /dev/ttyS0.
Baudrate (in bits/s) — Bits per second
9600 (default) | 50 | 75 | 110 | 134 | 150 | 200 | 300 | 600 | 1200 | 1800 | 2400 | 4800 | 9600 | 19200 | 38400 | 57600 | 115200 | 230400
Select the rate at which the data is read over the serial line. The baud rate is measured as the number of bits read per second.
Parity — Even parity or the odd parity added to the data
None (default) |
Select the parity added to the data transmitted. A parity bit is used to detect error in data transmission.
None – None value in this parameter means that no parity is used for error detection in the data transmission.
Even parity – The parity bit value is 1, if the number of bits with value as 1 is odd. The parity bit value is 0, if the number of bits with value as 1 is even.
Odd parity – The parity bit value is 1, if the number of bits with value as 1 is even. The parity bit value is 0, if the number of bits with value as 1 is odd.
Stop bits — The bit used as the stop bit
1 (default) | 2
Select the bit used as the stop bit in the data transmission. A stop bit marks the end of a unit of transmission.
Introduced in R2017a