| Reply | « Previous Thread | Next Thread » |
|
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)
|
|
Code:
import thread, miso
def vibrate(time, intensity):
miso.vibrate(time,intensity)
thread.start_new_thread(vibrate, (1000, 60))
|
| DrivingMobileInnovation |
| View Public Profile |
| Find all posts by DrivingMobileInnovation |
|
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)) |
|
Thank you to both of you, I'll check those out.
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| 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 |