Code as follows:
i var byte
time var byte
counter var word
time = 40 '(40 second run time)
for i = 1 to 10
counter = 0
while counter < time*500 '(40*500*10 = 200,000)
GPIO.4 = 1 '(75% duty cyle)
pauseus 150 '(pwm = 5000 hz (.000200 sec. period))
GPIO.4 = 0
pauseus 50
counter = counter+1
wend
next
Bookmarks