Issue at power on

I've recently tried your (Nick Gammon) I2C scanner (unmodified), which has this "while (not serial)" line in it on my uno.
The scanner waits for the serial connection to be established and only then runs the scanner once.

I modified it to (as practice) have the actual scanner in void loop() so now it runs continually after the serial connetion is up.
So i guess this also works for uno, even if you don't need to do that.
If OP has this code, he should comment it out and have another try at it.