Go Back   maemo.org - Talk > Software > Applications
 
Register FAQ Community Calendar Today's Posts Search

Notices

Reply
 
Thread Tools
  #1  
Old 2010-05-09, 15:18
MohammadAG's Avatar
MohammadAG MohammadAG is offline
 
Join Date: Oct 2009
Location: Jerusalem, PS/IL
Posts: 2,473
Thanks!: 1,091
Thanked 12,265 Times in 1,478 Posts
Send a message via MSN to MohammadAG Send a message via Skype™ to MohammadAG
Default Flashing Keyboard lights as patterns

After putting the device into R&D 4-5 months ago, I got the idea of using the keyboard lights as a VU meter. Last week I started looking into it and came up with a flashing pattern (similar to Knight Rider, as lcuk likes to call it )

http://www.youtube.com/watch?v=g3pvdFpA1II

Here's the script for this pattern:
http://mohammadag.ucoz.com/maemo/KR.sh
As it is, the above script is just for fun (won't do anything other than flashing the keyboard)

lcuk also pythonized it and added it to two apps, one is mostly just a proof of concept (should also play the Knight Rider music if you have mplayer installed)

.deb package: http://mohammadag.ucoz.com/maemo/kni...er_0.1_all.deb run it from terminal as root, by executing "python /opt/liqbase/KR/KR.py" (without the quotes)
.py file (for developers, it can be imported and used as a loading/busy indicator), by lcuk, http://mohammadag.ucoz.com/maemo/KR.py
Reply With Quote
  #2  
Old 2010-05-09, 15:45
lcuk's Avatar
lcuk lcuk is offline
 
Join Date: Apr 2008
Location: Manchester, England
Posts: 1,635
Thanks!: 1,486
Thanked 1,816 Times in 642 Posts
Default Re: Flashing Keyboard lights as patterns

maemo.org. A shadowy flight into the dangerous world of a man who does not exist.

Mohammad AG, a young loner on a crusade to champion the cause of the innocent, the helpless, the powerless, in a world of criminals who operate above the law.
__________________
liqbase sketching the future.
like what i say? hit the Thanks, thanks!
twitter.com/lcuk
Reply With Quote
The Following 14 Users Say Thank You to lcuk For This Useful Post:
  #3  
Old 2010-05-09, 16:35
brog brog is offline
 
Join Date: Nov 2009
Posts: 165
Thanks!: 32
Thanked 94 Times in 31 Posts
Default Re: Flashing Keyboard lights as patterns

Is it possible to tell the script to run e.g. 5 times in a row so it lasts a little longer?
Reply With Quote
  #4  
Old 2010-05-09, 16:38
lcuk's Avatar
lcuk lcuk is offline
 
Join Date: Apr 2008
Location: Manchester, England
Posts: 1,635
Thanks!: 1,486
Thanked 1,816 Times in 642 Posts
Default Re: Flashing Keyboard lights as patterns

yeah brog
thats easy
you see on the KR.py script it flashes a couple of times on startup

its simple to just adjust the loop and make it longer


i took this script and used it to make a 6key chord - pressing keys anywhere near the LED makes it light up and stay lit up indicating the mode.
turns the keyboard from 38 keys to 6

a bit of example code is posted here

http://twitter.com/lcuk/status/13642303906
http://liqbase.net/stuff/liqbubbles2.py
__________________
liqbase sketching the future.
like what i say? hit the Thanks, thanks!
twitter.com/lcuk
Reply With Quote
  #5  
Old 2010-05-09, 16:41
MohammadAG's Avatar
MohammadAG MohammadAG is offline
 
Join Date: Oct 2009
Location: Jerusalem, PS/IL
Posts: 2,473
Thanks!: 1,091
Thanked 12,265 Times in 1,478 Posts
Send a message via MSN to MohammadAG Send a message via Skype™ to MohammadAG
Default Re: Flashing Keyboard lights as patterns

Which reminds me, here's a manually made (yes, it was a pain) list of keycodes for the N900's QWERTY keymat - sorted by LEDs (which LED is closest to the key) (thanks go to qwerty12 for the xev binary)
Code:
LED1:
Backspace - 22
Enter - 36
Up - 111
Down - 116
Left - 113
Right - 114

LED2:
; - 59
. - 60
P - 33
O - 32
L - 46
Space - 65

LED3:
I - 31
J - 44
K - 45
U - 30
M - 58

LED4:
Y - 29
H - 43
N - 57
T - 28
G - 42
B - 56
F - 41
R - 27

LED5:
V - 55
E - 26
D - 40
C - 54
W - 25
S - 39
X - 53

LED6:
Ctrl - 37
Shift - 50
Blue arrow - 108
Z - 52
A - 38
Q - 24
Reply With Quote
The Following 12 Users Say Thank You to MohammadAG For This Useful Post:
  #6  
Old 2010-05-09, 16:43
brog brog is offline
 
Join Date: Nov 2009
Posts: 165
Thanks!: 32
Thanked 94 Times in 31 Posts
Default Re: Flashing Keyboard lights as patterns

This could be nice when playing emulators. Thinking of having only the keys lit that you use
Reply With Quote
The Following 10 Users Say Thank You to brog For This Useful Post:
  #7  
Old 2010-05-09, 16:53
Rapparee Rapparee is offline
 
Join Date: Nov 2009
Posts: 112
Thanks!: 17
Thanked 28 Times in 23 Posts
Default Re: Flashing Keyboard lights as patterns

Quote:
Originally Posted by brog View Post
Is it possible to tell the script to run e.g. 5 times in a row so it lasts a little longer?

Can you point out where i can maybe slow it down a little
Reply With Quote
  #8  
Old 2010-05-09, 17:08
lcuk's Avatar
lcuk lcuk is offline
 
Join Date: Apr 2008
Location: Manchester, England
Posts: 1,635
Thanks!: 1,486
Thanked 1,816 Times in 642 Posts
Default Re: Flashing Keyboard lights as patterns

rapparee - in the scripts there are pauses added by different means

bash
gsleep 0.05

python:
time.sleep(0.02)


alter as required
__________________
liqbase sketching the future.
like what i say? hit the Thanks, thanks!
twitter.com/lcuk
Reply With Quote
  #9  
Old 2010-05-09, 17:25
santiago's Avatar
santiago santiago is offline
 
Join Date: Mar 2010
Location: italy
Posts: 518
Thanks!: 95
Thanked 334 Times in 148 Posts
Default Re: Flashing Keyboard lights as patterns

is it possible to make an app that wokrs with different patterns for

sms, mms, call, simple digits etc?
Reply With Quote
  #10  
Old 2010-05-09, 17:29
lcuk's Avatar
lcuk lcuk is offline
 
Join Date: Apr 2008
Location: Manchester, England
Posts: 1,635
Thanks!: 1,486
Thanked 1,816 Times in 642 Posts
Default Re: Flashing Keyboard lights as patterns

santiago - sure eventually i see that happening
it makes a really bright indicator for some things and its eye catching
however it only works when the keyboard is slid open for obvious reasons
__________________
liqbase sketching the future.
like what i say? hit the Thanks, thanks!
twitter.com/lcuk
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 19:35.