I'm testing the Uno R4 Minima and tried a simple sketch:
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
//make sure the computer is actually waiting for the arduino
bool synced == false;
while(not synced) {
//wait for serial input
while(Serial.available() == 0) {
Serial.println("sync");
delay(1000);
}//while(Serial.available() == 0)
//get serial input
String recieved = Serial.readStringUntil('\n');
//if synced, break outer loop
if(recieved == "synced"){
Serial.println("synced");
synced = true;
}
else{
Serial.println("not synced");
}
}//while(not synced)
}// void setup
If I hit the reset button, the serial port seams to close as I can't reopen the serial monitor and have to manually reselect the port in the "tools"-menu.
I don't understand what's going on and would like to know how to avoid this.
With the old Uno R3 it worked perfectly fine.