Hello everyone! After finding out about the Arduino I ordered one. And I don't think I've unplugged it from my computer since! Well I have done many small project and such so far, I'm finding a wealth of information all over the net. But by far this Forum as been one of my favorite resources. Any-who, I have finshed my first little project, it's not much, but as a first project I'm very proud of it! After reading Todbot's Spooky Projects http://todbot.com/blog/spookyarduino/ I converted a pumpkin into a LED lighted pumpkin, complete with glowing eyes! Well that wasn't enough, and in the spirit of Arduino I enhanced my LED pumpkin, and here's where my project comes in! The LED glows, but when I blow across a simple little switch I tossed together, the LEDs flicker like a candle does when you blow on it! Soon after the LEDs return to normal operation. I know this isn't much, but then again its my first Arduino project.

/* * Wind Switch with Flickering LED * by Electrick_RWM (dragoonx@gmail.com) * Date Oct 18 2007 * Makes the LED on Pin 9 glow sloftly and when Switch or "Wind" Switch is toggled it flickers! * After the LED flickers it returns to its normal glowing loop until blown on again * * Thanks to TodBot for the Spooky Arduino Projects! * Without his tutorials I would have never been able to create this project * http://www.arduino.cc */

Well I hope someone out there can put the code and/or info to some use! If you have any questions just email me, or send me a message on here. I'll upload a picture and maybe a video to youtube of the pumpkin in use in the next couple of days if people ask for it.

Here is a close-up of the little Wind Switch. Really all it is, is Aluminum Foil hanging from a piece of wire, its light enough where if you were to try and blow it out like a candle it swings and makes contact, and completes the circuit. Its nothing special, but just a nifty idea that dawned on me when I almost used a Mic to receive the wind input. Because... Candles don't flicker when you talk loudly around them, so why use a Mic?

Here's a little video if it in action, Its not as vibrant in the daytime, but you can still see it function.http://www.youtube.com/watch?v=cdbzIHw2sMI

For now I'm off to go insert all these guts into that pumpkin in the background. Happy Halloween

This flickering led is something like what I needed for my first project, but I wanted it to be random instead of a repeating pattern, plus more than one LED. So, I came up with this sketch. Basically it generates a random value between -40 and 40, and adds that to the previous PWM value, while keeping it within the valid PWM range. This makes the value go up and down, but kind of stick around the boundary values. For example, once it hits the brightest value, it's even probability that it will stay that bright.

After writing this sketch, I have changed the random function to pick from -35 to 40, which keeps the LEDs more on the bright end, but they still venture down to darkness.

void loop(){ for (int i=0; i<=4; i++){ // for each led: analogWrite(ledPin[i], ledState[i]); // set the pwm value of that pin determined previously randNumber = random(-40, 41); // generate new random number and add that to the current value ledState[i] += randNumber; // that range can be tweaked to change the intensity of the flickering if (ledState[i] > 200) { // clamp the limits of the pwm values so it remains within ledState[i] = 200; // a pleasing range as well as the pwm range } if (ledState[i] < 10) { ledState[i] = 10; } } delay(100); // the delay between changes}