Greenhouse controlled with matlab and arduino with sensors and actuators

9 ビュー (過去 30 日間)
Mario Escalonilla
Mario Escalonilla 2017 年 1 月 31 日
回答済み: Jayaram Theegala 2017 年 2 月 8 日
I´m having problems with the outputs, I need the heater to work for a while (without delays) in arduino, but matlabs cycle makes arduino finish the loop and to start the serial communication again (top of arduinos loop), so that, the output (heater) is no longer "ON".

回答 (1 件)

Jayaram Theegala
Jayaram Theegala 2017 年 2 月 8 日
Are you sending commands to Arduino from MATLAB in a loop? If you want the heater to work for a while (in other words, having the corresponding pin to be in 'ON' state for a while) and do not want to use delays, you can use MATLAB's "timer" object. You can click on the following URL, for more information about the "timer" class:
And, within the 'TimerFcn' callback function, you can set the pin back to 'OFF'. Also, please note that the timer object may not exactly trigger at the time you set. If the application is time-critical you can use interrupts and use interrupt handling mechanism for setting the pin 'ON' or 'OFF'.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by