Yesterday’s code has several bugs:

As already mentioned, a delay is needed to let the serial data leave the USART before the pre-scaler change messes up the clock and baudrate. But there are also two other serious problems:
- the “limit = millis() + …” expression will overflow and fail (after about 49 days)
- the “millis() == limit” condition can “miss a beat”, leading to an almost-infinite loop
Both bugs can be fixed by carefully rewriting the code:

The differences are subtle, but essential. Without it, the loop will get stuck within just a few seconds of starting the sketch. With the above fixes it’ll run properly forever… I think.