C code for varying brightness of LED using PWM

Status
Not open for further replies.

puppy_55

Newbie level 6
Joined
Jul 2, 2008
Messages
11
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,331
I need your help in slowly varying the brightness of an led using pwm
I need 'c' code for that.
 

Re: C code for pwm

puppy_55 said:
I need your help in slowly varying the brightness of an led using pwm
I need 'c' code for that.
No one can give you C code for that without knowing the uC family.

Also, what is so hard about it? A duty cycle of 0% = completely off, 100% duty cycle = completely on, and in-between adjusts the intensity. The other factor depends on your hardware design -- the ballast resistor will determine the current and thus the brightness throughout the range.
 

Re: C code for pwm

C code for which microcontroller?
 

C code for pwm

C code for pic 16F877 microcontroller
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…