A simple LED program

Hi all,

a 100% novice here sorry,

I've been trying to work out the best approach for what i'm sure is a very simple project.

For example lets say I have 4 circles that I want to light up like a 'boot sequence'
Lets call the circles circle1, 2, 3 and 4 for this example.

I was the sequence to go
circle1 on white
circle3 blink red
//all LED off
circle1 on white
circle2 on white
circle4 blink red
//all LED off
circle1 on white
circle2 on white
circle3 on white
circle4 blink white then on green
//all LED fade to nothing
//all LED fade up white to 100% quick
//fade all down to 50% brightness

I was thinking this should be easy enough with something like a WS2801/2812 but all the code or examples seem to be waves or sequences where I kinda want to just address each LED individually at once.

I understand I can do this on the PWM pins with 7x standard (4x white, 2x red, 1x green) LED's and am going to start heading down this path but just wanted to make sure I cant do it easily with a WS or RGB LED easily first. Any guidance is greatly appreciated.

Leds
Which Arduino board do you have ?
Did you already buy or test RGB leds ?

All the leds can be connected in series. For the WS2812 (NeoPixel), use the FastLED or the Adafruit Neopixel library.
The examples are often sequences, but the leds can be addressed individually without delay. There is some delay for the timing, but that is probably very little.
The Adafruit NeoPixel library uses N * 30 + 50 microseconds. If you have 4 circles of 16 leds each, the update rate can be as fast as 500Hz.
I have a single NeoPixel led (I don't have a strip) and I update it with 25Hz rate. That is slow, but seems fast enough when I look at it.

The 5050 RGB leds without controller inside are just 3 leds in a 5050 package. They can be controlled with three PWM outputs. That might be used for one or two leds. Or with a transistor or mosfet for 1 or 2 circles. For 4 circles you need 12 PWM outputs, and 12 mosfets. It is possible with an Arduino Mega if you really have to. The leds can not be addressed individually.

I advice to use the NeoPixel leds. Then every circle and every led can be addressed.
Or the leds with a controller that does not need a timing specific signal (like NeoPixels), for example these : Digital RGB LED Weatherproof Strip - LPD8806 32 LED : ID 306 : $149.75 : Adafruit Industries, Unique & fun DIY electronics and kits

Sketch
The other part is doing different sequences and timing and delays at the same time. That is done with millis().
Start with the Blink Without Delay example : http://www.arduino.cc/en/Tutorial/BlinkWithoutDelay

You could make a function that writes the same value to all the leds in a circle.
A simple sequence like fading in and out can be programmed in the sketch. A specific sequency can be done with a table. With the use of millis() it is possible to fade every circle (or every led) regardless what the other circles are doing, as if 4 Arduino boards are controlling 4 circles.

Peter_n:
Leds
Which Arduino board do you have ?
Did you already buy or test RGB leds ?

I advice to use the NeoPixel leds. Then every circle and every led can be addressed.
Or the leds with a controller that does not need a timing specific signal (like NeoPixels), for example these : Digital RGB LED Weatherproof Strip - LPD8806 32 LED : ID 306 : Adafruit Industries, Unique & fun DIY electronics and kits

Thanks very much for your reply!

I have a Uno but also a Teensy 3.1 I am hoping to use, otherwise Oi'll look for the smallest board capable of what i'm after.

I have some spare WS2801's which is what I was looking into first but after looking into the NeoPixel or WS2812 I have found a lot of examples that I can use for my sketch.

The Uno will work with NeoPixel.
The smallest board is the Arduino Pro Mini board, you need an extra usb-serial converter to upload a sketch, since the usb is not even on the Pro Mini board.
The Trinket will also work with NeoPixel, but the Trinket has little memory.

There are of course many more Arduino (or Arduino compatible) boards between the Arduino Uno and the Trinket.

The Teensy needs an extra adaptor board for NeoPixel: OctoWS2811 LED Library, Driving Hundreds to Thousands of WS2811 LEDs with Teensy 3.0

Peter_n:
The Uno will work with NeoPixel.
The smallest board is the Arduino Pro Mini board, you need an extra usb-serial converter to upload a sketch, since the usb is not even on the Pro Mini board.
The Trinket will also work with NeoPixel, but the Trinket has little memory.
Adafruit Trinket - Mini Microcontroller - 5V Logic : ID 1501 : Adafruit Industries, Unique & fun DIY electronics and kits

There are of course many more Arduino (or Arduino compatible) boards between the Arduino Uno and the Trinket.

The Teensy needs an extra adaptor board for NeoPixel: OctoWS2811 LED Library, Driving Hundreds to Thousands of WS2811 LEDs with Teensy 3.0

Thats very helpful thanks! I would have assumed it would work with the Teensy fine without any adapter if we're talking about 4x NeoPixels?

In your opinion would the trinket have enough to do what I am after? The sizing needs to be small because it needs to go behind the front cover of a PC case. Its more of a height restriction (10mm) than anything else.

Somtimes I use an ATmega8 (8 kbyte flash). The sketch will fit when I start the project, but when I want to add a few things it is too small. That is why I rather start with an Pro Mini.

The Trinket has only 5.25 kbyte flash for the sketch. I think it will work. But then you start adding more sequences, adding a button, and decide to add fading intensity according to the human eye.. then you hit its limits.
There is a "Trinket Pro" which has the normal flash size of 32k, like the Arduino Uno, Nano, Pro Mini.

It is not a bad thing to buy two or three Arduino boards, you might use the other boards for other projects.