Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to user Serial Debugger and Winforms app at same time? (Read 2859 times)
Chad Hensley
Newbies
*
Offline


Posts: 1
Joined: Aug 16th, 2013
How to user Serial Debugger and Winforms app at same time?
Aug 16th, 2013 at 8:29pm
Print Post  
I am trying to talk to my Arduino (Due and UNO) boards from a winforms app.  I have a simple form that passes a 1 or 2 for turning an LED on and off.

However,  my Winforms app complains that the port is already being used.   

What I am trying to accomplish is to see if the correct value is being passed (read) from my Winforms app.   

Here is the example video I am trying to follow: http://www.youtube.com/watch?v=c-3mo3LRgUg

I have my LED in 13 and ground.  Here is the Arduino Code in the loop:

[code]if(Serial.available())
     { 
           int _iInp = Serial.read(); 
           switch(_iInp) 
           { 
           case '1': 
                 { 
                       //Serial.println("HIGH");
                         digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
                         //analogWrite(led, HIGH);
                 } 
           case '2': 
                 { 
                       //Serial.println("LOW");
                        digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
                        //analogWrite(led, LOW);
                 } [/code]

Any ideas?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to user Serial Debugger and Winforms app at same time?
Reply #1 - Aug 16th, 2013 at 8:38pm
Print Post  
Hi,

You need to use the debugger on a different serial port to your windows forms app because only one pc program can access the port at any one time. See the Project properties for more info.

The Due has more than one port but the Uno does not. 

For the Due connect a usb to Serial1 or Serial2 etc and set the RemotePort project property to Serial1 or Serial2 etc, set the LocalPort to whichever PC com port the connection provides.

With the Uno (or Due) you can use the SoftwareSerial option (RemoteTransport) and a usb/serial cable connected to a digital pin. A cable such as an FTDI cable provides USB to the Pc and the ability to connect to an Arduino digital pin. If you want break/pause you will need 2 digital pins (interrupts) for "trace only debug" we only need one digital pin.

This article shows more info

http://www.visualmicro.com/post/2013/04/26/How-to-debug-Arduino-on-a-different-u...
« Last Edit: Aug 17th, 2013 at 2:41pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint