Hi all. I have a problem where I'm getting errors if I try to access the Serial object.
For example:
void setup() {
Serial.begin(115200);
}
void loop() {}
Produces this error:
delay.h:23: In file included from
arduino.h:81: from
Repro.ArduinoSerialUsb.ino: from
Error compiling project sourcesRepro.ArduinoSerialUsb.ino: In function void setup()
variant.h: 220:37: error: 'SerialUSB' was not declared in this scope
#define Serial SerialUSB
Repro.ArduinoSerialUsb.ino:8: note in expansion of macro Serial
Serial.begin(115200)
^~~~~~
variant.h:220: note suggested alternative Serial2
#define Serial SerialUSB
Repro.ArduinoSerialUsb.ino:8: note in expansion of macro Serial
Serial.begin(115200)
^~~~~~
Build failed for project 'Repro.ArduinoSerialUsb'
So it looks like Serial is aliased to SerialUSB (which would be correct for the MKR WiFi 1010).
Looking in variant.h, I can see that SerialUSB is referred to in several places, but I can't see it defined anywhere, which would seem to explain the problem.
I'm running IDE 1.8.10 on Windows.
I can't believe they let a bug this obvious go out the door, so what did I miss?.