Use the HPWM command. Can't write the code for you, but one way is to use a counter and slowly ramp the duty cycle up and then down. Play with the pause times to get the effect you want. It will look better with 10bit PWM, try this first. Also search MBAM on the forum this works good for leds.
Code:Duty var byte Main: For Duty = 0 to 255 ' Gets brighter pause 100 HPWM 1, Duty, 1000 Next Duty For Duty = 254 to 0 step -1 'Gets dimmer pause 100 HPWM 1, Duty, 1000 Next Duty Goto Main
Bookmarks