×
Namespaces

Variants
Actions

Archived:How to make vibration in PySymbian

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngAquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.

Article Metadata
Tested with
Devices(s): N70, N95 8gb
Compatibility
Platform(s): S60 2nd edition, 3rd Edition
Article
Keywords: miso, misty
Created: cyke64 (15 Mar 2007)
Last edited: hamishwillee (31 May 2013)

Contents

Overview

Python does not provide a vibrate module, but an Open Source project from PDIS has developed a miso module which provides this feature.

Nokia provides the DLL on device from S60 2nd Edition FP2 (Nokia 6630, Nokia 6680) onwards, so Nokia 6600 (S60 2nd Edition device) cannot vibrate.

For S60 3rd Edition devices (e.g. Nokia N95), the follow-up module to miso, called misty, also works.

Preconditions

  • These extensions will work for S60 2nd edition devices and later.
  • You need to have the miso library installed for S60 2nd edition devices.
  • Install the misty module (download from here) for S60 3rd edition devices and just replace miso in the code below with misty.
  • At least some phones (e.g. N95) do not vibrate when either a usb or power cable is connected, so beware of that when testing this code. Also, your currently selected profile must allow for vibration as well.


Code Snippet

import appuifw, miso, e32
 
# run-and-break type of app
running = 1
def set_exit():
global running
running = 0
appuifw.app.exit_key_handler= set_exit
 
# main loop
while running:
miso.vibrate(500, 100) # vibrate for 500 millisec, at full speed
e32.ao_sleep(10) # vibrate every 10 seconds

Postconditions

  • The phone will vibrate for 500 milliseconds after running this script.
This page was last modified on 31 May 2013, at 04:04.
65 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×