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


Posts: 2
Joined: May 26th, 2015
Program runs in an infinite loop
May 26th, 2015 at 8:33am
Print Post  
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
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Program runs in an infinite loop
Reply #1 - May 26th, 2015 at 10:43am
Print Post  
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
Joined: May 26th, 2015
Re: Program runs in an infinite loop
Reply #2 - May 26th, 2015 at 11:06am
Print Post  
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
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Program runs in an infinite loop
Reply #3 - May 26th, 2015 at 11:20am
Print Post  
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 TopicPrint