# SPIOut

SPIOut 节点用于向 MCU 发送数据（通过 SPI）。 你可以在[此处](https://github.com/luxonis/esp32-spi-message-demo)找到演示。

[SPIIn](https://docs.luxonis.com/software/depthai-components/nodes/spi_in.md) 用于从 MCU 接收数据（通过 SPI）。

## 如何放置

#### Python

```python
pipeline = dai.Pipeline()
spi = pipeline.create(dai.node.SPIOut)
```

#### C++

```cpp
dai::Pipeline pipeline;
auto spi = pipeline.create<dai::node::SPIOut>();
```

## 输入与输出

## 使用

#### Python

```python
pipeline = dai.Pipeline()
spi = pipeline.create(dai.node.SPIOut)

spi.setStreamName("spimetaout")
spi.setBusId(0)
```

#### C++

```cpp
dai::Pipeline pipeline;
auto spi = pipeline.create<dai::node::SPIOut>();

spi->setStreamName("spimetaout");
spi->setBusId(0);
```

## 功能示例

 * [ESP32 的 SPI 代码演示](https://github.com/luxonis/esp32-spi-message-demo)

## 参考

### depthai.node.SPIOut(depthai.Node)

Kind: Class

SPIOut node. Sends messages over SPI.

#### setBusId(self, id: typing.SupportsInt)

Kind: Method

Specifies SPI Bus number to use

Parameter ``id``:
SPI Bus id

#### setStreamName(self, name: str)

Kind: Method

Specifies stream name over which the node will send data

Parameter ``name``:
Stream name

#### input

Kind: Property

Input for any type of messages to be transferred over SPI stream

Default queue is blocking with size 8

### 需要帮助？

请前往 [OAKChina 官网](https://www.oakchina.cn/) 获取技术支持或解答您的任何疑问。
