Square wave function programming on Arduino Due

Use timers or millis() to configure an PWM (pulse width modulation) wave.

Outport is high -> high voltage
Outport is low -> low voltage