if (flag == HIGH);The semicolon is the problem.
It ends the if statement.
The following block is executed always: 1 sec on, 0 sec off, 1 sec on, 0 sec off, ...
You won't see the 0 sec off
Remove the semicolon and don't care about Mike's comment ![]()
Perhaps he'd seen it, if you had used code tags ...