Hi!
I'm connecting a LED strip to Arduino using the schematics and code from this page:
However, turning them off ( turnOff() ) the lights don't turn off completely. How can I resolve this?
Many thanks
Hi!
I'm connecting a LED strip to Arduino using the schematics and code from this page:
However, turning them off ( turnOff() ) the lights don't turn off completely. How can I resolve this?
Many thanks
Many helpers don't spend their time digging down in project plans like in Your link.
Please do that work and show the schematics here.
void TurnOff() {
for (int i = 0; i < 256; i++) {
analogWrite(GREEN_LED, brightness);
analogWrite(RED_LED, brightness);
analogWrite(BLUE_LED, brightness);
brightness -= 1;
delay(fadeSpeed);
}
}
Ask Ian what you did wrong maybe?
He won't know any more than we do, but at least you would be annoying him, and he might learn something to improve his article, like posting complete code so that beginners can compare their version against that and figure out what they did wiring for themselves.
How long do you leave them turned off? Perhaps the time is so short you can't see it.
Paul
If "brightness" is greater than 255, it will not reach zero before the end of the loop. That could be it.
I can leave them off by 10 seconds or more and the LEDs glow very dimly
Print the variable in the analogWrite( ) to see what the last value that was sent to the LED strip pins.
Show us a good image of your ‘actual’ wiring.
Problem solved! making sure the variable "brightness" isn't negative is the answer! Thank you all!
unsigned int     byte
A schematic would be nice. I miss serial resistors between transistor bases and the controller pins. This puts the outputs in stress.
As usual in Fritzing paintings the project ought to be stone dead as there's no power to the controller. What transistors are used?
i.e. MOSFET gate.
Problem not solved.
The page you linked to suggests this code:
int brightness = 255;
...
void TurnOff() {
for (int i = 0; i < 256; i++) {
analogWrite(GREEN_LED, brightness);
analogWrite(RED_LED, brightness);
analogWrite(BLUE_LED, brightness);
brightness -= 1;
delay(fadeSpeed);
}
}
Guess what happens if you take 255 and subtract 1 from it 256 times over?
So the problem is still there, on that page. Other beginners will find the same problem and they too will come here asking for help.
@renatompereira If you truly wish to thank is, please contact Ian on that page and ask him to fix his page.
Okey. MOSFETs aren't downloading outputs the same way... Didn't notice the type....
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.