remove all those
while(!Serial);
not needed… learn how its supposed to work and adjust the code accordingly
you should write while(!Serial); just after serial begin and tell it what you want it to do while it is waiting for the serial monitor to connect… while !Serial means while the serial port IS NOT connected that is what the excelimtion point means (!)
reduce serial speed to 19200
Serial.begin(115200);
while serial just holds execution of the program until the serial monitor is connected, otherwise it will be all over and done with before you ever see it