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.
 
 

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 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fblogsE2eforumE2enokiaE2ecomE2fblogE2fpaulE2dcoultonsE2dforumE2dnokiaE2dblogE2farchivesE2f2009E2f04E2fX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZBlogContentQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtypeQUqfntypeZBlogContentQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZBlogContentQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ