Did you start the Serial Monitor before you started scanning?
The while(Serial); stops the sketch from running until you start the Serial Monitor. To ensure it is working correctly always close the Serial Monitor window, ensure the COM port is selected again after downloading a sketch and then start Serial Monitor again.