Hello all, I've been working on a sketch for some time now and to monitor the function I typically add code to print results of calculations etc. Up until this point I've seen no issues although I am mindful of the amount of memory used for printing so lots of text is stored on a separate memory chip on the MKR MEM shield.
So I created another 20 odd data points called baseMaxSound_1 thru 9 and baseAveSound_1 thru 9 and the calculations for them seem to work fine but when I try to print them the compiler balks at the following lines:
Serial.print("Ave Base Max Snd = ")
Serial.println(baseMaxSound);
Serial.print("Max 0-19 = ")
Serial.println(baseMaxSound_1);
Serial.print("Max 20-29 = ")
Serial.println(baseMaxSound_2);
Serial.print("Max 30-39 = ")
Serial.println(baseMaxSound_3);
Serial.print("Max 40-49 = ")
Serial.println(baseMaxSound_4);
Serial.print("Max 50-59 = ")
Serial.println(baseMaxSound_5);
Serial.print("Max 60-69 = ")
Serial.println(baseMaxSound_6);
Serial.print("Max 70-79 = ")
Serial.println(baseMaxSound_7);
Serial.print("Max 80-89 = ")
Serial.println(baseMaxSound_8);
Serial.print("Max 90-100 = ")
Serial.println(baseMaxSound_9);
Serial.println();
It also does so for the baselineAveSound variables.
Here is the compiler error I get:
C:\Users\Dickhead\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.4\variants\mkrgsm1400/variant.h:204:37: error: expected ';' before 'SerialUSB'
#define Serial SerialUSB
^
C:\Users\Dickhead\Documents\Arduino\sketch_dec8a\sketch_dec8a.ino:1546:5: note: in expansion of macro 'Serial'
Serial.println(baseMaxSound);
^~~~~~
When I eliminate the calls to Serial.println("variable name"); fro my sketch it compiles properly and returns the 49% of program space used for the sketch. Oddly enough there are a crap-load of these print calls from previous builds that give me no problems. I initialize these variables like so: uint16_t baseAveSound_9 = 0;
As a footnote I just updat3ed the board version to 1.8.4 thinking this was an easy fix. Of course it did not help.
Any insight is appreciated.
Mike