Help with fading led lights

Hi All,

I'm trying set up my Arduino Microboard to simulate fireflies turning on and off.
For those living in certain parts of the US you know what I'm trying to accomplish.
Hoping someone can help me write the sketch for about 9 LEDS to do this.
I'm still struggling how to program in C+. Ive tried using some of the samples but it keeps getting kicked back as an error.
Any help greatly appreciated.

Thank you so much.

You mean Arduino Pro Micro?

Have your read the forum guide in the sticky post at the top of the forum section?

Hi. Just "Micro" on the board. Its maybe one or two years old.

Thanks

Hi,

Honestly I haven't. Sounds like I need to. Am I in the wrong category looking for help?

Thanks

Hi Kirwin,

I think you are in the right place but you've come in without a real question.

Without knowing exactly what you have tried (What was the code that the Arduino IDE couldn't compile) how can we help?

Without knowing how your 9 leds are going to be wired up, we can't help by writing the code (it could compile but then your LEDS wouldn't work because they aren't in the right pins.

Rather than starting out to get 9 leds all fading separately have you tried just getting your board to do a blink sketch?

If you try a blink sketch on a digital pin, maybe you could try it on an analogue pin. Now maybe you could control the output of that pin?

There are a million ways we can help, but you aren't giving us the information needed to be able to do so.

1 Like

Like what these alleged errors are that keep getting kicked back.

a7

Hi,

Thanks so much. I understand. My apologies.
Ive used the sample analogue sketch for a fading LED on pin 9 and its pretty close to what I want. I guess what I want is to just copy and paste that sketch to include another 8 of them. I would like for them to light up randomly one at a time. A few short bursts by some. A little longer for others but never longer than about 2 seconds. I know the mistake Im making is in the void loop and probably very simple fix.
I only need to set up a board about once a year and whatever I learn the year before is forgotten. This is something I know I should be doing a lot if I'm going to get it down. Time is always my problem.

Thanks again

One problem I see is that Arduino Micro has only 7 PWM pins, and it sounds like you need 9. But if you truly mean you only need one of them to light at a time, then you will actually need only one PWM pin and 9 ordinary digital pins, which the Micro does have.

Let's see your attempted code and the error messages. Don't forget to read the guide before you post them.

2 Likes

Ok Thanks. will do.
Actually 7 will probably be enough work.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.