Controlling 2 LED bars seperately (1 fading in, 1 on/off) at same time

For a modelling project of a Lancaster I need to build a hardware setup of two LED bars controlled by an Arduino Uno (r3).

The general idea is to have a time cycle of 7 minutes. The process starts with a LED bar that's in the cockpit that turns on and stays on for the whole 7 minutes. After 2 minutes from the starting point the second LED bar fades in from 0 to 100% in 5 minutes time (an upcoming sun). Then everything turn off for 5 minutes and then the whole sequence starts all over again.

I need the PWN option on the board to make it all work.

Just got my Arduino and I have browsed the internet on subjects like these, but I couldn't find anything that comes close. Can anyone help me out here? Thanks!

Knibbel: I have browsed the internet on subjects like these, but I couldn't find anything that comes close.

This may seem like a cheap shot, but you won't likely find anything out there all set up to do what you have in mind. There are examples galore of your project's various facets. So you have have to glean those and integrate them into your whole.

You combine a few concepts, integrate them, and the result is what you want. At each of the following steps, you can work on them individually, and as you get them working, integrate them with the previous code.

First, get one LED turning on and off. See the "Blink" example. Second, get one LED ramping up from 0 to 100% brightness. See the "Fade" example. Third, do these things at certain times. See the "Blink Without Delay" example Now, turn on your first LED at time 0. Start ramping up the brightness of the second LED at time 2 minutes. Keep ramping up at the appropriate times with the appropriate values (you'll need to figure those values out). Turn off both LEDs at time 7 minutes. Start again at time 12 minutes.

Adjust your ramping up increment so it starts and ends as required at the times required. This will require you to find the lowest percentage brightness that is distinguishable from totally OFF. Play with the various times/values/increments until it all looks right.

Add the rest of your LEDs/bars.

You're done. A veritable masterpiece!

Thanks both for answering!

Maybe I'm a little confused, but I found some remarks that the Arduino can't do 2 tasks at the same time. But it seems it can be done. Over the weekend I'll try to make it work, otherwise I will come back for some help.

Wow, what a new world of electronics. So different (and all the same too) from 35 years ago. Brings back memories of making circuits and play with resistors. I would have dreamt about programming and a forum.

By the way, I found the Fritzing program and what a beauty to work with. Makes life a lot easier to plan. So much to look forward to.

Knibbel: Maybe I'm a little confused, but I found some remarks that the Arduino can't do 2 tasks at the same time. But it seems it can be done. Over the weekend I'll try to make it work, otherwise I will come back for some help.

Well, if you look deep down, it can only do one thing at a time..

But it's like a person. If you are making supper, you really can only do one thing at once, but you can get things going and set timers for some things, and manually check other things that are in progress.

You turn on the oven, setting it to a temperature, and start preparing the roast. When the roast is ready for the oven, you start preparing the vegetables. Oops.. the oven just beeped, indicating it's up to temperature, so you put the roast in, set a timer, and go back to preparing the vegetables. When the vegetables are ready, you start something else. All the while, you are glancing at the timer to see if it's time to start cooking the potatoes, or the vegetables, and so on.

You were multitasking, seemingly doing many things at once, but if you look at the process, you will see that you are only doing one thing at a time. The roast, while cooking, might need to be looked at, or basted, but you can't look into the oven while you are stirring the dessert, so you leave one task to do another, and come back to the task you left

Blink Without Delay is probably the first, and most important example of a technique you should learn well.

You mean Arduino is Hell’s kitchen, don’t you Lar3ry :)?

Just finished the sketch of the electronics. Now starting to Make it work on the breadboard. Keeping my fingers crossed and thinking already on the program I’m going to write. I will dig into ‘Blink without delay’ and see if my programming skills are sufficient.

Lancaster schema_schema dubbel_schema.pdf (458 KB)