I want my Raspberry Pi B+ Model to generate a triangle wave and output a PWM signal from one of the GPIO pins, but I'm not sure how to go about doing this. All I want it to do is add some small length to every next pulse until it hits 100%, then it subtracts some amount from every pulse width. So if the triangle wave is at its high peak the PWM is at 100% duty cycle, and if it's at its low peak the PWM is at 0% duty cycle. Any ideas or suggestions? Thank you in advance!
New note: For 6.28 seconds from 0% to 100% at 500 Hz