Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Debug Interfering with Code Execution. (Read 728 times)
Bunzino69
Newbies
*
Offline



Posts: 3
Debug Interfering with Code Execution.
Apr 24th, 2018 at 8:24pm
 
I have come across an issue with Visual Micro (VM) using Visual Studio (VS) 15.5.7.

When I compile and upload my code onto an Genuine Arduino Nano 328 and I select VM "Automatic Debugging (release/debug)" my code compiles and uploads correctly but it does not do what is expected.  I have set-up a PWM pin output (Pin 10) to pulse at a 10% duty cycle.  The only code is as follows:

void setup ()
{

analogWrite(10,10);
}

void loop()
{
//nothing here...
}


As the code starts to run, I see PWM pulses appear on my oscilloscope for just a flash (1/2 second maybe?). Then it output goes flat.

If I compile and upload without VM "Automatic Debugging (release/debug)" enabled the PWM output pulses hold without interruption - as expected.

The above happens with our without VS debug mode enabled.

I'm at a standstill on why this is happening. Seems like a bug but I'm new to VisualMicro. Any input would be appreciated.



Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10565
United Kingdom
Re: Debug Interfering with Code Execution.
Reply #1 - Apr 24th, 2018 at 9:36pm
 
Hi,

Maybe you are new to Arduino too Smiley

Code in setup() runs ONE time.

Code in the loop() runs over and over again.

Code (C++):
void setup ()
{

 //nothing here
}

void loop()
{

analogWrite(10,10);

} 

Back to top
« Last Edit: Apr 24th, 2018 at 9:37pm by Visual Micro »  
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print