ATTiny25 datasheet here.
6 I/O pins
If driving RGB LEDS you need at least 3 volts and preferably more.
LEDS should be current controlled, not voltage controlled. Trying to control voltages will lead to massive voltage:brightness non linearity.
Trying to make an overall brightness control is doable but given limited pins and more this cries out for a software solution.
As all LEDs are the same colour and brightness at a given time RGB control needs 3 pins.
LEDs are fed from a voltage source via a resistor or constant current source such that when on they operate at full desired brightness for that LED. That sets a max current which you then PWM on/off to vary current.
PWM LDs on/off so = max brightness or off.
- Adjust PWM duty cycles wrt to each other to get desired colour.
Then multiply each PWM duty cycle by a common brightness scaling factor.
eg say you have 8 bit PWM and a colour mix require 8:3:5 brightnesses.
Max PWM at full brightness is 255 count say. So
8 channel is set to 255.
3 channel is set to 3/8 x 255 = 86 counts.
5 channel = 5/8 x 255 = 159 counts.
The LED is now as bright as can be at that colour.
If 10% relative brightness is wanted then you can scale PWM counts to 26, 9, 16
This means that max brightness available will vary with colour.
- The following is written at a rush.
Concept is believed sound but it may be v hard to underatand, Ask if not clear.
If you want constant brightness for all colours then you will need to limit brightness that combinations can achieve to no more than th max achievable by any one colour by itself = 255 counts. As eg red is n=more inefficnt than blue this could mean the max count from red is say 150 counts but max blue = 255
A better method may be to adjust current sources per colour for max brightness in inverse order of efficiency so that when 100% on each colour is on same brightness they all have the same brightness.
eg say the relative brightnesses at the same current for R G B are 10:6:4 (made up) then setting the full brightness currents in the inverse ratio allows you to treat each the same as regards driver per brightess. eg
Red = 6ma,
Green = 10mA,
Blue = 15 mA
or 12,20, 30 mA or whatever.
THEN max brightness per LED with all 3 on should not be more than 85 counts each = 3 x 85 = 255 counts summed - As any one can not be > 255 by itself.
So full Red = 255 0 0.
These may be further reduced by PWM ing for brightness control.
If you can get 3 sets of LED drives you and your beloved will not regret it. This allows light chaser action with colours oozing along necklaces etc.
Years ago I did a go to finish project in under one hour that had a PIC drive LEDs in an angel halo with tinsel wrapper and battery back. LEDs all same colour but driven as light chasers. Basic program written in minutes cycled through flash, roll left, roll right etc. Halo worn as pat of costume by my daughter for a party. A bit dim in room light but fantastic effect on dance floor. That plus colour !!!!!!!!
ATTiny's 6 IO allow 3 x 3 mux = 9 = 3 sets or could add one small I/O IC.