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
Program runs in an infinite loop (Read 3273 times)
fnc13
Newbies
*
Offline



Posts: 2
Program runs in an infinite loop
May 26th, 2015 at 9:33am
 
I have created a program in Arduino IDE and I've successfully put it in VS 2013 Community (I've installed Visual Micro as well). I was able to choose the port, the Arduino board, but VS has underlined some functions like pinMode, digitalWrite, OUTPUT, Serial, LOW.... and when I get the cursor over them it says: "Error: Identifier undefined". The program uploads successfully on the board, but it goes into an infinite loop (I've tried it in Arduino IDE and it works perfectly)
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10529
United Kingdom
Re: Program runs in an infinite loop
Reply #1 - May 26th, 2015 at 11:43am
 
Hi,

Thanks for the post.

When you say infinite loop do you mean the board just keeps rebooting? setup then loop?

Please switch the tool bar from "debug" to "release2 or untick "tools>visual micro>automatic debugging"

If that fixes the issue the problem was probably a breakpoint in an invalid location but I will explain more about that after you confirm if that was the problem.

Thanks, please also confirm which version of Arduino you have installed and which board you are using.
Back to top
 
WWW  
IP Logged
 
fnc13
Newbies
*
Offline



Posts: 2
Re: Program runs in an infinite loop
Reply #2 - May 26th, 2015 at 12:06pm
 
I am using an Arduino Uno board and Arduino IDE 1.0.6.
When I said that it goes into an infinite loop, I meant to say that the program starts but it doesn't wait for a command. It takes all the command one by one, and then it repeats this all over again. (the program should have waited for the user to give a command, like "Aon", or "Aoff" - which is memorized into a string variable; but instead it runs all the commands).
I think i know where the problem is, but I haven't fixed it yet: it's on the string variable. VS doesn't recognise the string tipe; and also, I used a character to be added to the string using the operator "+", and it shows an error there as well.
The thing it's working perfectly on Arduino IDE...
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10529
United Kingdom
Re: Program runs in an infinite loop
Reply #3 - May 26th, 2015 at 12:20pm
 
Thanks for the info.

I think this is possibly just some confusion. Hopefully you are using the Arduino 1.0 option in Visual Micro?

1)
VS intellisense is entirely separate to compile. So you can ignore what VS says is correct or not. We will address the intellisense issue when we have solved the loop.

2)
Visual Micro handles the compile fully. VS does not have any connection to it so you should have the same problem in the Arduino Ide. You can see the exact compiler commands by switching on "tools>visual micro>verbose" and "arduinoide>file>preferences>verbose compile"

I suspect that the code you are using in Visual Studio is slightly different to to the Arduino ide. I can tell you that if you append to a string so that it becomes larger than the assigned amount of memory then the arduino will crash and appear to be in an infinite re-start loop.

Please try the identical code in the arduino ide.

Thanks
Back to top
 
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print