HI can we put a PWM command in?
Hi this program is great that Mel has writen can we use the same program but soon as the button is pressed led go high for 500 / 1/2 second then PWM 50 duty and 5KHz and then then pwm stop when button is released?
i have the program working but the PWM hangs on after the button is off
PushButton var PortA.1 ' Low when Pressed
DIPSwitch var PortA.1 ' Low when ON
LED var PortB.0
TRISA=%1111
TRISA=%0000
Low LED ' Start with LED OFF
Loop: If PushButton=0 then ' Check for Button Press
If DIPSwitch=0 then ' Check for Options
High LED ' Turn ON LED with Button Press...
PAUSE 500
PWM 0,50,500
While PushButton=0:Wend
' Wait here as long as Button pressed
Low LED ' then turn OFF LED
else
Toggle LED ' Toggle LED at each Button Press
While PushButton=0:Wend
' Wait here until fingerreleased from Button
endif
endif
Goto Loop
End