Help writing arduino code

hewito

Active Member
Hello,could anybody help me write an arduino code,I am looking to make 4 leds come on(maybe some fade effect) the adafruit sound board and a small mini blower at the same time,maybe once you turn on the arduino to stay on for 30 seconds be off for 30 second and repeat..help please!
 
Hi hewito,

I don't claim to be an expert with Arduino, but I have dabbled a bit.
I see you are going to use an Adafruit sound board and most likely looking to trigger it and powering a mini blower.
Is the blower for cooling something and powered for the 30 second delay?
Will the 4 LEDs be independent of each other or wired together to come on at the same time?
Which Arduino are you set up to program?
Any other detailed information would be helpful.

.
.
 
Hi hewito,

I don't claim to be an expert with Arduino, but I have dabbled a bit.
I see you are going to use an Adafruit sound board and most likely looking to trigger it and powering a mini blower.
Is the blower for cooling something and powered for the 30 second delay?
Will the 4 LEDs be independent of each other or wired together to come on at the same time?
Which Arduino are you set up to program?
Any other detailed information would be helpful.

.
.

Hey prop master,we always seem to be interested in same threads!!..ok ,now,the fan blower is the type to cool a costume(like this one https://www.amazon.com/Mini-Fan-Inf...id=1479488464&sr=8-1&keywords=mini+fan+blower ) but I dont need it for cooling, I want to use it to kinda move fake snow within the globe,hope it makes sense,the leds will be together,so they will come on at same time with same fade effect(if you have any Christmas effect idea for led even better!!)
I have arduino uno...What I am trying to make is a snow globe custome for my gf, when you turn on a switch the lights will come on,the music will play and the blower will make the snow all crazy..Maybe to have a 30 sec Christmas jingle,then everything will turn off.wait about 20 or 30 seconds(i will appreciate if I could modify that time later just in case)and then everything will come back on,I planning to put about 4 different jingles,but I will use only one adafruit channel,what do you think?
 
Hi hewito,

First off you mention that you are using the UNO to do this project.
Are you familiar with the coding that is part of the EXAMPLE sketches such as BLINK and FADE?
Have you loaded either code (blink and/or fade) to the UNO and connected an LED to see how they work?
This could be useful and adapted to your project.

.
 
Hi hewito,

First off you mention that you are using the UNO to do this project.
Are you familiar with the coding that is part of the EXAMPLE sketches such as BLINK and FADE?
Have you loaded either code (blink and/or fade) to the UNO and connected an LED to see how they work?
This could be useful and adapted to your project.

.
Hello..Yes the fade from the library is useful but it only works for one led,,I thinking on putting 4 or even 6 leds..besides,I still will need the code for the blower and the adafruit..any ideas?
 
Another question:
Are the 4 to 6 LEDs for lighting the area or just for show (detail lighting)?

You can modify the existing blink/fade codes to fit your needs, but you must save it as a NEW code under a different name.
The code below is very preliminary and can be modified as you go, but is a good starting point.
////////////////////////////////////////////////////////////////////////////////////////////////////////////

.
 
Last edited:
Heh. Welcome to Arduino. It was designed for the artist (well, boostrapped on to the Wiring language, but anyhow....) In any case, is very helpful to grok the philosophy of Arduino. Which can be summed up in the single word "hack."

Arduino programs don't need to be works of art. The philosophy is, work fast, work loose, borrow everything you can and re-purpose it, and if it works, then good enough!

Want to light four LEDs? Copy and paste the same chunk of code four times and change the pin number. Inelegant as hell but it works.

Well, okay. Hacking doesn't mean you can't leverage labor-saving devices. In fact, anything but. Take those same four LEDs. Write something like (below is pseudo-code, do not copy and paste as is!)

int someled = 1; ///LEDs are on pins 1,2,3 and 4

for (someled = 1; someled < 5; someled ++)
{
digitalWrite (someled, HIGH);
}

The most basic and useful tool, a loop that just repeats something you want done over and over (plus changing a few things each time).
 
This thread is more than 7 years old.

Your message may be considered spam for the following reasons:

  1. This thread hasn't been active in some time. A new post in this thread might not contribute constructively to this discussion after so long.
If you wish to reply despite these issues, check the box below before replying.
Be aware that malicious compliance may result in more severe penalties.
Back
Top