holmes4:
@robin2 - I think the op wants to throw away all input before the 3 seconds, hence the flush. The old spec (only on the arduino) was to clear the input buffer.Mark
Looking at his code, the flush statement is inside the if (3 seconds elapsed) loop. How will it flush anything before 3 seconds has elapsed?