Home > PIC > RELAY ON OFF
Uploaded: 18-07-2012
Code Rating:
Chip: PIC
Dev Tool: C
File Size: 43KB
Uploaded by: rparthiban69
Downloads: 0
Points Required: 5

Code Description

The PIC reads the voltage coming out of the pot, which is in the range 0..5V, and redirects it to a built-in ADC with a 10-bit resolution. The ADC value, which is in the range 0..1023, is used to set up the duty cycle ratio of the PWM running at 244Hz (the minimum frequency achievable by running the PIC @4MHz). The PWM resolution in this case is 1024, hence matching the one of the ADC. The PWM output is available at pin RC5 drives LED through a current-limiting resistor. This way effective voltage on the LED is proportional to the pulse width of the PWM, which affects its brightness.PWM duty cycle ratio 3/4 (approx.)

Latest Codes

Download

 Download [Click to enter the download page]

Todays Top Downloads

Top Downloads this Month

Top downloads