do { //read RTC}
Serial.print(second);
while (second <= 30);
}
Inside of that loop you do not actually read the RTC.
Unless an interrupt sets the value of "second", second will not change.
You want the do-while loop here. It lets you read the RTC before making the while() compare. If you use a while loop, you need to make a read before the while loop and a read inside of it as well.
do
{
static unsigned long lastSecond;
second = some.kind.of.read RTC;
if ( second > lastSecond ) // keep from printing the same seconds over and over, keep from overflowing the serial output buffer
{
lastSecond = second;
Serial.print(second);
}
} while (second <= 30);