There is one questionable thing about this, when I have a led at the output to test the pwm. i see like a flickering. the reason why I think this is the case. is because the correct pause sequence is not there. Can you please help with a better solution
remove the capacitor around your 20MHZ crystal an post the answer.
I was wondering how do I control the pwm for this. lets say I have a button .. and while I pressed the button the PWM will increase
refer to this section
Code:
' Let's see how many time we have come here
' -----------------------------------------
'
if PWMIncStep<600 then
PWMIncStep=PWMIncStep + 1 ' not enough, come again and do
' one more PWM increment step.
else
pwmincstep = 0 ' enough is enough, pass go and claim 200$
' Also, since you're there redo the ramp-up
'
toggle timerled ' toggle status LED
endif
the easyest solution is to add a simple IF THEN statement
Code:
' Let's see how many time we have come here
' -----------------------------------------
'
if PWMIncStep<600 then
If PushButton then ' If pushbutton is pressed
PWMIncStep=PWMIncStep + 1 ' do the PWM
endif
else
pwmincstep = 0 ' enough is enough, pass go and claim 200$
' Also, since you're there redo the ramp-up
'
toggle timerled ' toggle status LED
endif
Bookmarks