I make it very simple, I use analogWrite(pin, pulsewidth);
So i make this, arduino pin 9 makes 2.5V for 500ms, then up to 5V for another 500ms, then back to 2.5V. Is that ok? Here is video: