フィルターのクリア

Read data from multiple analog inputs via Arduino-Computer serial link

5 ビュー (過去 30 日間)
Jon Schofield
Jon Schofield 2018 年 1 月 4 日
回答済み: Milton 2018 年 1 月 12 日
I've configured the serialRunOnArduino and serialRunOnPC models to allow me to record data from an analog sensor on pin A0 of an Arduino Mega. However, I need to read data from two analog sensors, plot separately and save data to the workspace.
I'm struggling to do this so any help would be appreciated.
Here are some screenshots of the serial link models as it stands, including my attempt to add a second serial transmit block.
Best,
Jon

採用された回答

Milton
Milton 2018 年 1 月 12 日
If you are using two serial output on Mega, then TX0/RX0 and TX1/RX1 are used.
You can check the schematic of Mega. You will find TX0/RX0(PE1/PE0) are connected to USB.
Thus, you will find TX1/RX1 are Pin 18&19. You need to connect this to PI to a TTL to USB board so that you computer can read.
If you just want to use the existing USB from Mega, you need to 'Byte Pack' block to packet two signal together then send it out. From you PC part, you will use 'Byte Unpack' to separate this two signal.
These two blocks are introduced in R2016b

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by