Serial port and current operation (Arduino)
    2 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
    Jasmine Shragai
 le 22 Sep 2016
  
    
    
    
    
    Modifié(e) : Hans Scharler
    
 le 20 Juil 2018
            Hello!
I am working with Matlab on Arduino (using G-Code) and am having some trouble.
For example, I would like to run a script in MATLAB that contains a loop. The thing is, that Matlab doesn't know that the Arduino is not finished with current operation yet, and is continuing the code, ignoring this.
As a result, the Arduino actually performs only the first operation.
How can Matlab know when Arduino is finished current operation? Maybe the is a method for all kinds of COM connections?
Thanks!
Jasmine
0 commentaires
Réponse acceptée
  Walter Roberson
      
      
 le 22 Sep 2016
        
      Modifié(e) : Walter Roberson
      
      
 le 22 Sep 2016
  
      The official way for serial ports is to configure the serial port with 'flowcontrol' set to 'hardware', and have the arduino lower the CTS (Clear To Send) pin while it processes the data, setting it high again when it is ready for more.
Plus de réponses (0)
Voir également
Catégories
				En savoir plus sur Modeling dans Help Center et File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

