Bit Bang PWM for RGB common cathode LED using ADC

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

zen
Posts: 8
Joined: Tue Dec 21, 2010 9:50 pm
Has thanked: 4 times
Been thanked: 5 times
Contact:

Bit Bang PWM for RGB common cathode LED using ADC

Postby zen » Mon Jan 03, 2011 2:43 pm

I thought I would post this FCV4 program up for anybody needing a program to control a RGB LED's color using bit banged pwm outputs that are controlled using ADC inputs from two potentiometers. I looked for a while trying to find an example of a program like this and I had no luck. This program should run on most any chip that has three outputs and two ADC available..just modify the I/O port names to those on your chip you plan on using. I have also drawn out how to make a simple circuit for this program in the component section. A better way to build this circuit would be to use three potentiometers, one for each color, however this setup will produce a wide range of colors. If any of you have any suggestions for simplifying or improving on this program I would like to hear it.
Note:
This project was built on the 16f887 using the internal osc. set to 8mhz

I owe credit to medelec's program that was posted demonstrating a bit banged led dimming program that can be found here viewtopic.php?f=26&t=6512&p=14003
Attachments
RGB BIT BANGED PWM CHANNELS.FCF
(21.74 KiB) Downloaded 459 times
These users thanked the author zen for the post (total 3):
trisb (Mon Jan 03, 2011 4:33 pm) • medelec35 (Tue Jan 04, 2011 7:58 am) • Benj (Thu Jan 06, 2011 1:35 pm)
Rating: 17.65%