I am having some trouble trying to get my Arduino Mega to wait for a button press. I thought possibly I could use an IF inside a while loop...but it never exists the while (or do while) loop. Also, has anyone else had trouble with a Mega printing to an I2C 16x2 LCD? I can not get mine to print anything in Setup() and not reliably in loop() unless I farm it off to a function. Works fine in that case?
Anyway, what I am trying to do is below...and please, except for a class in BASIC 30 years ago when I was 14, and two books by Simon Monk in the last week I have no programming experience. And ignore the int K stuff...that was just so I could see if it was stuck in the loop and, yes, I am.
I guess I am not sure how to do that. I know I have too many global variables, not enough experience and I am trying to do something somewhat complicated, running an LCD, 4 LDR, an SD card, and a laser. Probably not the best "first project" for learning programming....but I am so very very close, I think tomorrow or the next day it will work. making the last 2 weeks worth it.
How would you tell the LCD "Don't update unless anything changes". I couldn't get that command to compile :))
I follow, mostly. And will try. I must say though, this Arduino is magic, and I have had the best time screwing with it over the last several weeks.
Like anything, I simply need more experience....I have read books, have the syntax, commands, etc pretty good I think...but like the error tonight, I lack the experience of seeing it, or better, doing it a million times in the past.
As an aside, you ever hear of anyone with the same issue I am having with my Mega...can not print to the LCD in setup, and only about 90% reliable in loop (exact same code works perfect on my UNO) unless farmed out to a function? Just seems weird. I saw a bunch of posts from people having LCD issues but seemed mostly an address issue.
But you chose not to show us all of that so you're kind of left on your own to figure that out.
When you're ready to solve the serial issue, post the whole code or at least a complete code
Again that you for your help and suggestions. The truth is, except for my head I have no schematic. I have not found any software yet that can do simple circuits. Just massively complicated packages with thousands and thousands of parts in the library..... As for the code, nothing secret, I didn't know if I should post the entire 4-5 pages or just the part I was having trouble with. In the future I will post all the code (as an attachment? Can I do that here?). I can post a picture of my hardware, but likely it will not make any sense without a schematic. I checked the topics but could find none for asking about schematic software so if this is in the wrong section, accept my apologies. Suggestions though for schematic software, 3D printer software (next purchase) will be happily appreciated.
OK, that I can do. I will post it tomorrow night. I can also post the code, it is really no big deal, I am trying to set up a delayed choice double slit experiment. Read about those a couple years ago and personally, considering the ramifications, I want to see it for myself.
This is the schematic program that I use if you want an easy to learn package. It hasn't the power of the big ones (Eagle, KICad) but makes a very nice schematic. Making your own parts is easy, too.
This looks like it might be perfect. I only took a quick peek, but seems way easier than some of the others I have seen. Thank you for taking the time to give me the link.
I took it as a reply to my saying it wasn't magic in the post before.
Fair enough. I read the whole sentence after seeing your post saying that is wasn't magic, and got a completely different impression. I can see how you arrived at yours, though.