Radio Receive
Receive data from micro:bit devices via radio
Libraries:
Simulink Coder Support Package for BBC micro:bit/Radio
Description
The Radio Receive block receives data from other micro:bit devices through a wireless connection.
Limitations
You can use only one Radio Receive block in a model.
The block can accept a maximum of 254 bytes in one sample time.
Ports
Output
Data — Received data
vector
At each sample time, the port outputs received data as an N-by-1 array of the type specified in the Data type parameter and size specified in the Data length (N) parameter.
Status — Status of received data
scalar
The status port outputs one of these values:
1
—Data is received.0
—No data is received.–1
—Data is corrupted during reception.
Parameters
Channel number (1–100) — Channel selected to receive data
1
(default) | any integer from 1 to 100, inclusive
The channel number at which you want to receive data.
Note
The transmitter and receiver must be set to the same channel number.
Data type — Type of data to be received
double
(default) | string
| single
| int8
| uint8
| int16
| uint16
| int32
| uint32
| boolean
The type of data the block receives. The size of each element depends on its data type.
Data length (N) — Number of data units to be received
10
(default) | double
| single
| int8
| uint8
| int16
| uint16
| int32
| uint32
| boolean
The number of data units received at each sample time. The range of permitted units is dependent on the data type, as summarized in the table:
Data type | Range |
---|---|
double |
1–31 |
single |
1–63 |
int8 |
1–254 |
uint8 |
1–254 |
int16 |
1–127 |
uint16 |
1–127 |
int32 |
1–63 |
uint32 |
1–63 |
boolean |
1–254 |
Sample time — Interval at which the block reads data
0.2
(default) | -1
| any nonnegative value
When you set this parameter to -1
, Simulink® determines the best sample time for the block based on the
block context within the model.
Version History
Introduced in R2017b
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)