I am trying to create code that will output a signal roughly mimicking the first image below. (The waveform is from an electrical muscle stimulation unit) The frequency is around 24Hz with a duty cycle of 0.6. Is there an easy way to create a better waveform then what I have in the second image? The relevant code below seems to be sending things in binary (all or nothing) but I thought the PWM inputs could emulate analog by 255 degrees. Am I wrong about that? Thanks.