Marine Navigation marker buoys light sequences

Hi,

Frist of all i am a complete newbie, As i have only started 2 weeks ago to all of this and need some help please…

Has anyone ever added 3mm led bulbs to an Admiralty Chart ? As this is what im trying to do at the moment. I have seen one video on youtube with them and looks cool… For those that dont know an Admiralty Chart is its a marine navigational chart that shows the depts coast line and more importantly marker buoys and lighthouses which is what i want to show.

I can make the lights flash in a sequence which is what i want. And i came across the code on this form and i find it very helpful.
The problem i have is how to get each light to flash differently then the other but not after each other like in a delay…
Because lets say you have four marker buoys 2 red and 2 green on the chart.
Red 1 will flash twice every 4sec, Red 2 will flash 3 times every 10sec, Green 1 will flash twice every 4sec and green 2 will flash 3 times every 5secs and so on… All together i will be putting 25 leds to the chart.
Is this possible to do ? also i recently bought the mega 2560 and have the unoR3.

To give you an idea what im doing i have added a photo (its not a video)

Thanks in advance.
marinenav

This is just another LED flashing exercise, easily doable, and Mega will have more than enough pins. It wouldn't surprise me if Uno could do it if you added some diodes and/or a matrix control chip like the MAX7220 into the mix. Millis gives you 1000 pulses a second, and I submit it is just a matter of counting them to control the LED conditions.

There is a Blink Without Delay example (sometimes known as BWOD) that should be instructive.

Look at the “blink without delay” example. Rather than delaying until it’s time to turn the LED on or off, you check the time and turn the bulb on or off if it is now time to do so, falling through and doing nothing if it isn’t. With this method, you can do a number of things at (apprarently) the same time.

loop() {
  for(int i = 0; i< number_of_leds;i++) {
    if led[i] is off and it's time to turn it on, then turn led[i] on;
    if led[i] is on and it's time to turn it off, then turn led[i] off;
  }
}

You could consider using smart LEDs like these behind the chart. You can then have colour, fade, flashing and as many LEDs as you want using only two pins. Once you wire them, everything else is done through software.

Thanks for all your your help and il post up the finished project in the next few days or so.... those smart LEDs look cool and ill look into it davidrh..

Thanks

I have done some commercial work similar to this (which unfortunately I can't share here), but the basis of the navigation beacon flashing sequences can be controlled from an earlier sketch I wrote called MultiBlink. You can find MultiBlink in my code repository (link in the signature block below) - version 4 is the best choice for this application and can be modified to work with NeoPixel LEDs very easily.

The demo Several Things at a Time is an extended example of BWoD and illustrates the use of millis() to manage timing.

It flashes 3 LEDs and can easily be extended to as many as you have I/O pins for.

...R