You Are Here:

Community: Developer Discussion Boards

#1 Old how do create a simple thread? - 2008-07-08, 20:42

Join Date: Mar 2008
Posts: 127
jtullis
Offline
Regular Contributor
Hi, I have no experience with threading - I'd appreciate any advice.

I'm using the vibrate function from the miso module. Commands in my program have to wait for miso to finish before they execute. So if I call a 5 second vibration, the next commands won't execute for 5 seconds.

Can someone show me how to pop the miso.vibrate call in a separate thread please so my commands can continue while the vibration takes place? I have no idea how to do this, and have turned up no joy searching for threads or threading.

Thanks, John

Code:
    miso.vibrate(1000,60)
    img.clear()
    img.text((115,168), u"1", fill=(0,0,0), font="title")
    canvas.blit(img)
Reply With Quote

#2 Old Re: how do create a simple thread? - 2008-07-09, 02:00

Join Date: Mar 2008
Posts: 57
DrivingMobileInnovation
Offline
Regular Contributor
Code:
import thread, miso
    
def vibrate(time, intensity):
    miso.vibrate(time,intensity)

thread.start_new_thread(vibrate, (1000, 60))
Reply With Quote

#3 Old Re: how do create a simple thread? - 2008-07-09, 09:45

Join Date: Jun 2005
Posts: 382
y.a.k
Offline
Regular Contributor
Yes, this should work (if you're allowed to call miso.vibrate from subthreads). If all you want is to call miso.vibrate, you don't even have to define a function.
Code:
import thread, miso

thread.start_new_thread(miso.vibrate, (1000, 60))
Reply With Quote

#4 Old Re: how do create a simple thread? - 2008-07-09, 17:23

Join Date: Mar 2008
Posts: 127
jtullis
Offline
Regular Contributor
Thank you to both of you, I'll check those out.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
console app running problem xcompass General Symbian C++ 3 2009-05-08 14:26
How To Create a simple IF ELSE application in Carbide.vs tiyyob General Symbian C++ 4 2008-05-13 07:06
How to create a simple dialog symb_devel Symbian User Interface 4 2008-05-09 13:48
Simple thread creation erst General Symbian C++ 11 2007-05-02 03:34
Thread Kalderas General Symbian C++ 4 2003-08-14 16:02

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