Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Vibrate module
-
if possible I would like to request
vibrate
module - would be nice for games etc. -
It's relatively easy to trigger a simple vibration using
ctypes
, but there's no API to control the duration, intensity etc.import ctypes import time c = ctypes.CDLL(None) def vibrate(): p = c.AudioServicesPlaySystemSound p.restype, p.argtypes = None, [ctypes.c_int32] vibrate_id = 0x00000fff p(vibrate_id) if __name__ == '__main__': for i in xrange(3): vibrate() time.sleep(0.5)
-
Sweet! That's perfect for my use case.
-
Is this now easier with
objc_util
? -
Pure c calls are basically the same with or without objc. Since the vibrate api is pure c, and not part of an objc class, the code would be the same.
-
Ok, just wondering. Thanks.
-
@omz Thank you for your Vibrate module.
The process went successfully when done according to your instructions.
At a time such as when you are on the phone and the alarm goes off, can it vibrate for a long time?
Objective-C seems to write in this way.
http://stackoverflow.com/questions/1490028/iphone-dev-performselectorwithobjectafterdelay-or-nstimer