Whenever you're ready, walk me through how you'd approach this.
Write out the C implementation of a Finite State Machine which outputs various voltages from a pin on a microcontroller.