Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Long sleep in pys60 (See related posts)

e32.ao_sleep has a 2147-sec limit. Here is how to
sleep longer. Based on dashboard's exttimer
import e32

def sleep(delay, callback):
    MAX = 2147
    if delay > MAX:
        e32.ao_sleep(MAX, lambda : sleep(delay-MAX, callback))
    else:
        e32.ao_sleep(delay, callback)

You need to create an account or log in to post comments to this site.


Click here to browse all 5147 code snippets

Related Posts