Lanterne is a small app for working with the LEDs used to create a flash for the N900's camera. At the moment, it supports "torch" mode (continuously light the LEDs at low power), and "strobe" mode (a quick flash of the LEDs at high power). Also, holding down the "strobe" button will cause the LEDs to flash continuously (a "strobelight" effect).

The LED power, the duration of the strobe, and the pause between strobes can be modified.

Warning: I am not an expert on the flash LEDs! Although I have made an effort to ensure that only safe values can be entered for these parameters, I cannot say for certain that this app will not damage your LEDs. Use with caution!

At this point, several features have been added:
* A Morse code flasher, allowing you to type in a message or load a text file to be transmitted. The dot duration is configurable.
* A continuous SOS beacon.
* A continuous pulse (essentially, Morse E rather than SOS).
* Support for use with the red (indicator) LED.

Lanterne now recognizes the status of the camera cover, and avoids turning on the LEDs if it is closed (and will turn off the LEDs if the user closes the cover). Also, it can now exit when the user closes the camera cover.

Version 0.5.6 has been added to the end of this post, as well as submitted to the extras-devel repository.

Lanterne is open-source software, released under the GPL version 2 (or greater). You can find the source code at Github:

I have always wished to be able to type out and flash morse code with the flashlight. Possible?

It shouldn't be hard, at least in terms of turning the LED on and off. (I have to admit I never learned morse code myself, so I probably don't know all the tricks involved; I know a bit about how letters and numbers are keyed, but I think there's something more intricate involved when keying out full words and sentences...)

In any case, hooking up keyboard keys to sets of LED pulses shouldn't be too hard. I guess you could also feed text files into the thing and get series of pulses out...

It'd probably be easier to work with this using the "torch" mechanism rather than the "flash" mechanism, as I'd have finer control over "torch" timing; would you need the highest-level brightness for your morse code flashes?

Ok, version 0.1.0 of Lanterne is now on its way up to extras-devel. From the pull-down menu, you can now select "Morse Code", which will bring up a window with a text entry field; type your desired text into this field, click "Transmit Code", and the LED will flash out the characters for you.

There is also a "Dot Duration" spinbox; you can use this to determine the length of a dot. (A dash is three dots, dashes and dots are separated by a dot-length pause, characters are separated by a 3-dot-length pause, and words are separated by a 7-dot-length pause.)

This is just standard Morse alphabet, taken off of the Wiki page for Morse code. I haven't tried to add any internationalization or shortcuts or whatever (and I probably don't know enough to do it right anyway). But, at least, it should support the basics.

Now, the _really_ interesting app addition imho would be to have the N900 read incoming morse code, not just transmit it. Dunno just how much effort that would take, though...

Thank you for this application.
One request (if you are taking any)...
I have always wished to be able to type out and flash morse code with the flashlight. Possible?

You must have read my mind! One of the applications which I have planned for when I get into programming is a morse code application. This is one of its features, but it is a bit more ambitious than that. I am going to start learning programming for the N900 next month, but I don't know when I will become productive.

Ok, version 0.1.0 of Lanterne is now on its way up to extras-devel. From the pull-down menu, you can now select "Morse Code", which will bring up a window with a text entry field; type your desired text into this field, click "Transmit Code", and the LED will flash out the characters for you.

There is also a "Dot Duration" spinbox; you can use this to determine the length of a dot. (A dash is three dots, dashes and dots are separated by a dot-length pause, characters are separated by a 3-dot-length pause, and words are separated by a 7-dot-length pause.)

This is just standard Morse alphabet, taken off of the Wiki page for Morse code. I haven't tried to add any internationalization or shortcuts or whatever (and I probably don't know enough to do it right anyway). But, at least, it should support the basics.

Now, the _really_ interesting app addition imho would be to have the N900 read incoming morse code, not just transmit it. Dunno just how much effort that would take, though...

This is amazing. LOL. I had also thought about the detection module. I don't know how feasible it is though. Ideally you would want to analyze a live video buffer without actually saving it on the fly, and perhaps apply some sort of levels filter to better detect on-off events.

Personally, I think doing this is a challenge, but I wouldn't put it past you to come up with a way to do it.

It shouldn't be hard, at least in terms of turning the LED on and off. (I have to admit I never learned morse code myself, so I probably don't know all the tricks involved; I know a bit about how letters and numbers are keyed, but I think there's something more intricate involved when keying out full words and sentences...)

CuteCW is a morse code application I use on N900 maybe worth a look if you fancy.
Normally there is a character per second value but there is nothing too complicated about sentences in morse.

Originally Posted by Copernicus

In any case, hooking up keyboard keys to sets of LED pulses shouldn't be too hard. I guess you could also feed text files into the thing and get series of pulses out...

Thank you for the new version.
I was imagining a live keyboard type method but typing a string and pressing enter works fine.

Originally Posted by Copernicus

It'd probably be easier to work with this using the "torch" mechanism rather than the "flash" mechanism, as I'd have finer control over "torch" timing; would you need the highest-level brightness for your morse code flashes?

You wouldn't need flash brightness IMO. I would stick to known safe limits of the LED's where possible.