This code example generates a square wave using the TCPWM resource configured as a PWM. An LED connected to the PWM output pin blinks at 2 Hz.