Pages: [1]   Go Down
Author Topic: Lighthouses  (Read 1801 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Faraday Member
**
Karma: 23
Posts: 3470
20 LEDs are enough
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

In the German Arduino Forum someone was asking for a lighthouse emulator. Here is my implementation for it.

http://blog.blinkenlight.net/2013/03/01/lighthouses/
http://blog.blinkenlight.net/experiments/basic-effects/lighthouses/

IMHO the slickest part is how you declare the lighthouse parameters smiley

-Udo
Logged

Check out my experiments http://blog.blinkenlight.net

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 200
Posts: 12774
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
static uint16_t phase = setOutput(led);

...is clever but may not work correctly for some Arduino / library functions.  Static initializers are called before init.
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 200
Posts: 12774
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


200 ON,  2800 off,  200 ON,  2800 off,  200 ON,  5800 off ?

I always assumed lighthouse sequences were just on for a bit then off for a bit.  Probably a good thing I haven't spent much time on any boats.   smiley-grin
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 200
Posts: 12774
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


That is a clever solution.  I like it.  (Which is saying something because I can't stand templates.)
Logged

0
Offline Offline
Faraday Member
**
Karma: 23
Posts: 3470
20 LEDs are enough
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I know that static initializes are called before init. However in this case this does not matter.

The timings are official timings of the lighthouses. I think 5800 off is not that bad if you think about the top speed of a vessel that has to rely on lighthouses.

And thanks for the flowers with regard to the templates.
Logged

Check out my experiments http://blog.blinkenlight.net

Pages: [1]   Go Up
Jump to: