Hallo Seeeders,
once again I have some mysterious things going on and I need your kind help!
I’m trying to use the VCC pins 1-8, using digitalwrite and analogwrite,
to control some led group, about 3-4 leds for each VCC output.
I have 2 types of led, but each group have only same-kind:
BIG-> 3.2 volt // 100mA
NORMAL-> 3.4 // 20mA
Power supply gives 12v, 2A.
The code, a simple (0-255) fadein-fadeout analogwrite, works, but the led never get as brights as they should,
always remain very dim, about 1/3 of maximum brightness.
If I measure the VCC outputs I have:
-> about 2,5V when (analogwrite = 255)
-> about 1V when (analogwrite= 0)
I suppose this has something to do with the “resistor-free circuits” inside rainbowduino,
unfortunately I don’t really understand how to get higher voltage/amperage out.
Or may be related to the rainbowduino ATMEGA168 PWM implementation?
Should I access the pins directly using some BITSHIT code accessing the registers,
without the analogwrite functions of the arduino IDE?
I hope there’s an easier solution…
Another weird thing is that some leds fade smoothly, other just switch on/off,
but they receive the same analogwrite command! I suppose it’s caused by the “delay” interacting with PWM…
What am I doing wrong?
Thanks a lot for your help,
I’m getting crazy with this!
bless,
kk
Here’s the simple code I’m using:
void setup()
{
for(int i = 10; i >=3; i --)
{
pinMode(i, OUTPUT);
}
}
void loop()
{
for(int i = 3; i <=10; i ++)
{
fadeDown(i);
delay(50);
}
for(int i = 10; i>=3; i --)
{
fadeUp(i);
delay(50);
}
}
void fadeUp(int pin)
{
for (int k = 255; k >= 0; k -= 5)
{
analogWrite(pin, k);
delay(30);
}
}
void fadeDown(int pin)
{
for (int k = 0; k <= 255; k +=5)
{
analogWrite(pin, k);
delay(30);
}
}