Instructables
Randomness. It is so easy in the real world. In the electronics world, well...it is really hard. Sure it is possible to create "pseudo-random" effects but not truly random. The only way to actually create randomness is to use programming. Even then, randomness will eventually repeat itself.

Fading. It is also hard.Without programming, it is possible but it is not efficient. The circuits aren't small. In fact, most fading circuits use large capacitors that take up space. Not pleasing.

Put these two together and it is extremely tough to make.

In the end, I must subject to programming.

To be specific in this case,

Arduino programming. 

This project involves Pulse Width Modulation and is achieved through the use of an Arduino, a computer and a breadboard with LEDs. Inverting a signal will be achieved through the use of sinking and sourcing.


Update: I changed the code a bit. It now fades a bit faster and a bit better and smoother to view. If you downloaded the code look again at the code.
 
Remove these adsRemove these ads by Signing Up

Step 1: What You Need.

You will need:
An Arduino
6 LEDs (possibly more.)
Jumper Wires
Breadboard and/or protoboard
 
brzi1 year ago
You should use curent limiting resistors on your LEDs, baud rate didnt killed it!
Higgs Boson2 years ago
This works well, but the LEDs repeat a pattern.
blinkyblinky (author)  Higgs Boson2 years ago
So, you're saying you made it?

Also, did you sink and source?
Yeah. I did sink and source, and I used your code. It starts out seeming random, but after a while a pattern emerges.
blinkyblinky (author)  Higgs Boson2 years ago
Try rewiring the sink and source. Plus, don't stare at it too long otherwise the pattern will emerge.

I will now rework the code.
You've heard of the random function on the arduino right? have you tried using it in the code? I'm trying to use
int x = random(1, 7)
to get a random number, and list all of the combinations the lights could be, and use the number gotten from the result of the random function to randomly select one of the combinations (and yes I know that that would only be capable of choosing only 6 possible combination of something like 30 to 36.)
blinkyblinky (author)  Higgs Boson2 years ago
I guess I'm more low-tech than I thought I was...

:-)

I will try that.
that's something I just learned today. I'm trying it now, so if I get it to work I'll post it here.
blinkyblinky (author)  Higgs Boson2 years ago
My Arduino has died!!! DO NOT TRY THE RANDOM CODE AT THE WRONG (TOO FAST) BAUD RATE!!! IT WILL KILL IT!
that's weird, what was the baud rate that you used?
are you going to order another atmega, or get a new arduino?
blinkyblinky (author)  Higgs Boson2 years ago
I have new ATMEGA328s. They just don't have the bootloader.

The EEPROM seems busted...the TX LED stays on all the time.

I will have to run the Command Prompt to see where it doesn't work.
Okay well I hope you get it working. I will continue experimenting with the code. I might try using radomSeed, and use an analog pin with nothing attached.
blinkyblinky (author)  Higgs Boson2 years ago
I am ready to rip my hair off my head.
blinkyblinky (author)  Higgs Boson2 years ago
Great. Let me know about you results.
BrunoG3 years ago
Yay I´m the first to write a cament.
Very cool I did it and it works!!!!
Thanks!
blinkyblinky (author)  BrunoG3 years ago
Good for you!