How is utime.sleep() realized?

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
Hasenradball
Posts: 14
Joined: Tue May 21, 2019 12:52 pm
Location: Germany
Contact:

How is utime.sleep() realized?

Post by Hasenradball » Tue Aug 27, 2019 8:32 am

Hello Guys,

I would like to understand how is the sleep function (utime.sleep()) realized on hw.
Because if it is implemented as the same way like a delay() in Arduino style the controller stops all activity for the specific time.
Right?

Or is utime.sleep() realized in a other way?

User avatar
jimmo
Posts: 553
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: How is utime.sleep() realized?

Post by jimmo » Tue Aug 27, 2019 8:50 am

That's right - if you want to do something smarter I would recommend taking a look at asyncio

Peter has an excellent tutorial here https://github.com/peterhinch/micropyth ... UTORIAL.md

Post Reply