MKR1300 Standalone Transmit and Receive

try commenting out the

 while (!Serial);

which will hang looking for a serial connection