how can is use software pwm and combined with hardware pwm
I have a rgb led and an attiny 13a wich has only 2 pwm.
I already have done a project with an conventional arduino and a rgb lamp that fades between random colors, ofcorse using 3 pwm pins from the arduino.
If the library doesn't work (I've not tried it on the 13A) it's not hard to implement software PWM on any of your output pins especially for a project like this that has little/no user interaction. For example if you keep track of the number of times loop() is executed with a global variable, loopCount if you only turn on your Red pin every 2nd cycle through loop() you'll get the equivalent of analogWrite(R, 128). That would look something like this (off the cuff, normal caveats apply for typos etc etc):
unsigned long loopCount;
const int redPin = 0;
const int greenPin = 1;
const int bluePin=2;
void setup() {
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void loop() {
loopCount++;
digitalWrite(RedPin, (!(loopCount % 2)); // 50% duty cycle
digitalWrite(greenPin, true); // 100% PWM, ie completely ON
digitalWrite(bluePin, (!(loopCount%5)); // every 5th, 20% duty cycle
}
Not sure if you're familiar with the modulo (%) maths operator but it is the remainder of the division. By testing for the opposite (ie not) of that, you'll get a positive each time that division has no remainder.
From the above it's not a big stretch then to come up with a function to set the PWM value of all 3 colours,
void rgbPWM(int R, int G, int B) {
// stuff
}
such that it can take a range of values either from 0...255 as you're used to seeing in analogWrite() or 0-100 as a percentage, or whatever you'd prefer. Your loop() would increment loopCount then work out what the 3 values need be for this part of your animation, and the final line in loop() woudl be a call to rgbPWM(). Since loop() will be run thousands of times a second, the result will be a smooth RGB transition effect like you're chasing.
Hope that made sense - I'll leave you to fill in the blanks
Geoff