Controlling the Brightness of an LED (Using PWM in PIC)

Thread Starter

kaybie14

Joined Nov 9, 2009
4
hello guys.. i have a project intending to control the brightness of an LED light using PWM in PIC microncontroller.. i also used LDR as a sensor. I find some difficulty regarding the program of PWM as well as the program for the sensor that there is no need for ADC.. can you help me regarding this matter that can make me understand the concept of the program? or can you provide me a sample program for this.. thank you guys..
 

retched

Joined Dec 5, 2009
5,208
Do you want the LED brightness adjusted with the LDR?

If so, you should use the ADC to read the LDR and determine the PWM for the LED.

There sure are a lot of 3 letter abr.
 

ELECTRONERD

Joined May 26, 2009
1,147
What language will your be using? They have a BASIC language compiler that will transfer your code to the C language. All you would need to use is the PWM command for BASIC:

Rich (BB code):
PWM 0, 150, 1000
Where 0 = Pin number 0
150 = Duty cycle (0-225)
and 1000 = duration in mS.

Austin
 
Top