Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Make A Phone Vibrating Periodically

DZone's Guide to

Make A Phone Vibrating Periodically

·
Free Resource
Some of my friends who practise mindfulness meditation
use an alarm device that vibrate every 2 minutes and
he will become mindful then.
Danny O'Brien of Life Hacks fame asked me about this too.
So, here's a short example (without parameter setting GUI)
that does exactly this.

You need to have miso library install. Only Series 60 
2nd Ed FP2 device (Nokia 6630, Nokia 6680) can be used.
See vibrate(...) in miso documentation
http://pdis.hiit.fi/pdis/download/miso/miso-1.40-api.html

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

I don't have a FP2 phone to test this. Though the code is
pretty straight forward, please report if there is a problem.
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}