Thanks Srig,
This section is part of a bigger program, which i am perhaps three quarters of the way through.
I am looking at using the simplest PIC which is the 16F84. At the moment i am using a 16F876 for development purposes.
The project at the moment has three RGB LEDs on PortC 0-2. When you push a switch, each of the LEDs lights as a solid colour.
For example, the first switch push lights Red, Second push lights Green and then the third lights Blue. The forth switch push Fades Red up and down continously, fifth push, fades green up and down continously, etc etc.
All this code has now been completed.
I then want the seventh button push to then create the spectrum effect. ie the colours of the rainbow start at an aqua colour then finish at white. Then cycles back down again, white through to acqua.
As i say, ideally i would like to do it using software PWM, but am struggling a bit.
I have found some code here http://www.electronic-projects.net/S...er/Rainbow.htm
If i am right, using this sample code, if the value of x was to vary from 0 to 255, then you will get the spectrum using the 3 LEDs. But is this piece of code using Hardware PWM? If so, how would i change it to Software PWM.
All i really need at the moment is a stand alone routine which performs this RGB effect. Once this is working right, i can then introduce it into the rest of my code.
Any help is always welcome along with recommendatiosn etc. I am new to this, but loving every minute of it to see a finalised working idea !!
Thanks again,
Steve.
Bookmarks