Hi, I need your help....My project is about a astronomic dome system, my arduino nano is freezing...And I don´t know why??....I was reading this post, and I don´t know how change my strings for arrays, please help me with that.
I can to send my code. Please answer me!! I am new in this post. Thanks.
If you're a beginning programmer, the trick is to "develop" your code by writing & testing one or two lines at a time* so if there' s a problem you know there's something wrong with the last couple of lines you've written. More experienced programmers can write bigger chunks of code, but nobody writes the whole program before testing!
It's also helpful to send little messages and variables out to the serial monitor so you can "see" what your program is doing (and hopefully see where/when things are going wrong).
There are millions of ways to make a bug in a program! And, the compiler will only tell you if the program doesn't "make sense" to the compiler... It doesn't know what you want the program to do...
So your problem may not the string or array related, but arrays can be trouble if you write past the end of the array. The most common mistake is forgetting that arrays start at element zero... A 100-elelement array goes from zero to 99 and if write to element 100 you can crash your program. The same thing can happen if you write-past the end of a C-style string. (Your program won't usually crash/freeze if you read past the end of an array or string, only if you write past the end, corrupting your code.)
* You can't just start at the top and work-down because the compiler has to see a complete (simple) program and you need ways of knowing if it's working and doing what you expect.
It's a bit of a learned-skill knowing where to start, but usually you can start with the input (i.e. reading a switch or pot, etc. and "printing" the result) or with the output (i.e. turning-on an LED or relay, or running a motor, etc.)
Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Did you write the code or is it from another source?
If another source, can yo post a link to the site?