Hevans1944 covered just about every aspect from a uC control , others ave covered other approaches.
What you do not seem to be able to accept is there are logically 2 states required in the output.
Therefore, which ever approach is used, a 2 state input is required.
If one were to toggle...