Using PWM on a 18F13K22

Status
Not open for further replies.
I would be interested in seeing the code 3v0 came up with.
As for seeing the led "blinking", yes one can see a definite flashing or in this case a flicker.
I should do a video with the camera farther away then I shouldn't get any bright flash of light as the videos show.
WHY I can see a definite flash or blinking ?? but it adds "flavor" to the effect.
 
....WHY I can see a definite flash or blinking ?? but it adds "flavor" to the effect....

Excuse me while I pound my head against the wall and knock myself senseless.

Let me assure you you can't see any difference at the 5 kHz PWM frequency. That's 200 times faster than your eye can perceive. In phase, out of phase...makes no difference other than the ratio of on time of yellow LED and red LED.

What you ARE SEEING is the difference in duty cycle as your code progresses. Remember that?

Duty = x

Inc (duty)

Etc, etc, etc.

This is why the LEDs vary in brightness.

Geez oh grief. #headsmack #headsmack #headsmack
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…