be80be
Well-Known Member
Here the whole code and working good thank's to 3v0
Code:
SetAllDigital
// main program...
SetFreq(5000)
Duty = 0
While true
PWM.SetDutyPercent(Duty)
If ( (sw0 = 1) And (Duty < 10) ) Then
Inc(Duty)
DelayMS(10)
EndIf
If ( (sw1 = 1) And (Duty >0) ) Then
Dec(Duty)
DelayMS(20)
EndIf
Wend
End