You Are Here:

Community: Blogs

Jurgen Scheible's Forum Nokia Blog

My mobile phone has feelings, too - Nokia 5500: How to program the tapping sensor with Python for S60

leninsgodson | 14 November, 2007 15:36

See a 1min. video and find the code. When I was preparing today a course on 'creative mobile phone programming' with Python for S60 for an event next week, I added some exercise to my PyS60 online tutorial that utilizes the built-in tapping sensor of the Nokia 5500. While people have been doing great stuff already for a while with the Nokia 5500 sensor by building their own Python extension, I was happy to see a few weeks ago that Python for S60 v.1.4.1 came out with an own module called sensor (beside a range of other new modules and functions such as video recording, ....). While the sensor module of Python for S60 works nicely with the N95 spilling out rotation status information (see the code here), I wanted to get the module to work with the Nokia 5500 as a tapping sensor, so I can tap with my finger two times on different sides of the phone in order to trigger some other phone functionality.

The functionality that came first to my mind was text to speech, which is something nice for the ear and just takes one line of code: audio.say(text). This lead to the situation that I suddenly discovered that my phone also has feelings. What had happened? Out of fun I typed various sentences to be spoken by the phone, when tapping it on different sides. Among the sentences were e.g. "don't do this again!" or "I like that" or "this hurts" and "yes, I love you, too". When I put the ready Python for S60 script on the phone and tested it, it felt weird, but nevertheless so real. My phone complained to me that I treated it physically wrongly, or gave me some appreciation for what I did when touching it - it suddenly had feelings, too.

As mentioned before you can watch a video of the "my_phone_has_feelings" application here (http://www.youtube.com/watch?v=exC1YICrM6Y) and test the script yourself making your Nokia 5500 to express its feelings. You can find the entire code (26 lines) as a Python for S60 script here: http://www.mobilenin.com/pys60/ex_5500_tapping_sensor.php.

This short incident triggered lots of ideas in my head what else I could use the tapping sensor for i.e. when an sms arrives, I tap the phone two times on the right side and it reads out the message (see code snippets for such things here), or when the phone rings, I'll answer it by tapping on the display, or I turn my phone into a joking machine that reads out good or bad jokes by randomly tapping different sides. Well, this might not sound like something new as such, but the point is that one can do all of that now in Python for S60 in an easy way with just a few lines of code.

Once again this scripting approach has demonstrated to me how easy and quick it is to get your idea turned into a working app. For those interested in learning to program Python for S60, there is also a book available called Mobile Python - Rapid prototyping on the mobile platform (Wiley) http://www.mobilepythonbook.org/ , which offers a quick path into programming Python for S60. Also my online tutorial is available at http://www.mobilenin.com/pys60/menu.htm.

I guess I'll write in detail in some of my forthcoming blog entries on how to use the Rotation sensor of the N95 with Python for S60, and also how to use the Nokia 5500 sensor as accelerator sensor. In the meantime I'll keep enjoying the feelings of my mobile phone - at least for a little while.

RSSComments

Great thinking!

croozeus | 14/11/2007, 17:23

croozeus

I have been waiting to explore the sensor too! Waiting for my 3rd edition device for that! Python is a great tool for mobile application developers Which can do phenomenal things with the minimum amount of code!
The sensor is such a thing that enters the mobile into a new arena of thinking and having feelings (as such)
I hope to see more of it still!
Good Work!

sensors with PyS60 !

cyke64 | 14/11/2007, 21:42

Hello Jurgen,

This tapping sensor is cool :D
Is it possible to use it on N95 ?

As you should know now : N95 has also full accelerometer X , Y and Z axes !!!
NRC provide an AccelerometerPlugin for N95. http://research.nokia.com/files/N95_RD_Accelerometer.zip
They provide one cool example : MovingBall !
There are now many examples of using it !

Inclinometer from DrJukka http://drjukka.com/
LightSaber 1.1 from Graham Oldfield http://www.zoeandgraham.co.uk/lightsabre/
RotateMe 2.0 from Samir (soon) http://www.bysamir.fr/rotateme/
Nokmote from Samir (soon) http://www.bysamir.fr/nokmote/
Cube from Jethro.fn in PyS60 (Plugin is accessible with my aXYZ module :-)
http://www.symbianresources.com/projects/#sensor
CarMeter and gBoarder
LightSaber for 5500 in PyS60 with pyextaccel module http://noselodigasalolo.blogspot.com/2007/10/nokia-5500-como-una-espada-lser.html

In PyS60 there are severals solutions :
1) sensor module
2) pyextaccel 0.9.2
3) aXYZ 1.0.2 developped by me for supporting AccelerometerPlugin for N95.
This allow to use the full accelerator feature hidden in N95 (X,Y,Z axes)

Cool examples in PyS60 :
Cube from Jethro.fn in PyS60 (Plugin is accessible with my aXYZ module :-)
LightSaber for 5500 in PyS60 with pyextaccel module http://noselodigasalolo.blogspot.com/2007/10/nokia-5500-como-una-espada-lser.html

ACCELEROMETER X , Y , Z
5500 : sensor but pyextaccel works too
N93i with firmware >= 20.0.064 : sensor
N95 8GB : sensor but aXYZ should works with Plugin and aXYZ
N95 classic (old firmware) : aXYZ 1.0.2 with plugin

TILT X (top,bottom,right,left)
N95 classic with firmware < : pyextaccel 0.9.2 (adapted by me :-)
N95 classic with firmware = : sensor

TAPPING
5500 with sensor module

I'm waiting for your examples :)
This new features provide many possibilities only limited by your imagination :D
I hope my thought about this could help you :-)

Best regards
Cyke64

Ac

Trackback

OscarBernabeu | 16/11/2007, 18:22

http://www.xatakamovil.com/2007/11/16-mi-movil-tambien-tiene-sentimientos

any other code?

WODAK | 29/11/2007, 12:17

Hello!
I just wanted 2 say that this blog and your online book is really great.I'll also try to write my own scripts in python in next days on my nokia 5500. I'm a Java programmer (also J2ME) so I hope it wont b to hard 2 start with python :)

I have only one more request...I'm really interested in programming some python scripts with suport 4 accelerator sensor. So I was wondering if u have any more examples for nokia 5500? (not just the tapping screen but also examples with OrientationEvent)
I've would b really pleased if u add them to ur page...
Oh and I'll share my progress with programming in python...

thank u!

My Mobile Phone have feeling too

andi | 17/12/2007, 11:51

Iam Interesting about making phone to have feeling it is very cute.where can i download it?and can i using it at java phone or you have the java version? you guys are so sophisticated man

My 5300 might have feelings too?

droso | 28/12/2007, 16:56

Hello, I have a Nokia 5300, and would like to do some python divertimentos on it, is there somewhere you can point me out to start? it would be a great excercise start doing things for my phone. Thank you in advance for your advise.
Cheers

Re: My mobile phone has feelings, too - Nokia 5500: How to program the tapping sensor with Python for S60

yda4huk | 08/04/2008, 07:40

Thank you in advance for your advise.
I have a Nokia 5300

www.gsmprofile.com

Dotmark | 09/08/2008, 11:28

Do you want to buy a new phone? Do you want to know about roaming partners and network? Just go to http://www.gsmprofile.com and view, search and show your phone specification .If you loss your mobile manual you can get it from http://www.gsmprofile.com easily.
Dotmark

mail@gsmprofile.com
http://www.gsmprofile.com

http://www.gsmprofile.com/phone/sagem/sagem_my850v.php
http://www.gsmprofile.com/phone/sagem/sagem_my850v_pictures.php
sagem my850v

You must login to post comments. Login
 

Rate This

 
 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia