Bath Overflow Error When Compiling Script

Hello all!

I am still very new to Arduino and have bitten off a rather large bite for myself having also never coded before. I am in the middle of building a remote weather monitor using 2 analog and 2 digital sensors. Ideally, those sensors feed the data into the adafruit Datalogger shield to save on SD card.

I have functional code to read just the sensors but when I try to blend the data logging code, I get Batch overflow errors. I am still extremely new with C code...throw in Java and I'm a lost puppy.

My code is below for review. I have tried to clean it up as much as possible. I am beginning to think the entire code is wrong. This code is a conglomeration of the sample code given by each sensor and the data logger. I only stitched it together and added in the syntax I prefer for Serial output.

Please let me know! Thanks!

Apparently my code is too long. It is located here on gitHub for review:

https://github.com/ThisNerdyGuy/ArduinoProjects.git

The errors I am receiving:

Exception in thread "Thread-5" java.lang.StackOverflowError
	at java.util.regex.Pattern$Loop.match(Pattern.java:4295)
	at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227)
	at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078)
	at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345)

That's the shortened version. The java.util.regex lines continue on my compiler for quite some time. If posting them all would help please let me know.

This is my first post! I hope I followed all the rules (I actually read them!). I look forward to seeing you all more frequently as this project progresses!

Personal Site: http://thisnerdyguy.com

Try Auto Format (Ctrl/T) on your code. It reports that there are too many left parentheses, hence it won't compile. That problem need to be fixed.

Excellent! I had no idea that existed and I guess I was using the wrong keywords while Googling. I will try that now and report back. Thanks!

You should never get to the point of writing a large piece of code before you try and compile or test it.
You should break your problem down and do little bits at a time. Compile, run, test and modify until your code grows naturally. Then you know if it won't compile that the error is in the last little bit you did.

Hint. If you place your cursor to the right of an opening bracket the closing bracket is indicated. If it is not the one you expect it to be you have an error. Work through the code and see which ones are missing.

Grumpy_Mike's advice is spot on, as always. If you have a large amount of code that has never been compiled, and especially if the control structure is wrong, and even more especially if it was written by a novice, you can expect a nightmare task of fighting past error after error just to get it to compile, let alone work correctly. Breaking this down into a sequence of small enhancements makes this job massively easier. But in the specific case of the error being reported here, what you've got is not actually a compiler error, it is a crash in the Arduino IDE's parsing code used to perform the mucking-about it does to convert your sketch into C++ before invoking the real compiler. In other words, it's a bug in the IDE. What should have happened in this situation is that the compiler should have output an error identifying the place where the mismatching brace was detected.

UKHeli was absolutely correct!
I went through line by line, as you do, but could not, for the life of me, find this extra parenthesis. Instead, I started over and took GrumpyMikes advice.

The code finally compiled! There's still some tweaking I need to do regarding how it logs the data, but the code itself functions! Pretty cool feeling knowing I made this from scratch and its working!