<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/esp8266/modpybrtc.h, branch esp-extra-scripts</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=esp-extra-scripts</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=esp-extra-scripts'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2016-06-06T09:51:12+00:00</updated>
<entry>
<title>esp8266: Let RTC work correctly after deepsleep.</title>
<updated>2016-06-06T09:51:12+00:00</updated>
<author>
<name>puuu</name>
<email>puuu@users.noreply.github.com</email>
</author>
<published>2016-06-03T15:21:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ee12581a3545c6e950b4a2b5322167eb73326928'/>
<id>urn:sha1:ee12581a3545c6e950b4a2b5322167eb73326928</id>
<content type='text'>
By design, at wake up from deepsleep, the RTC timer will be reset, but
the data stored in RTC memory will not [1]. Therefore, we have to adjust
delta in RTC memory before going into deepsleep to get almost correct
time after waking up.

[1] http://bbs.espressif.com/viewtopic.php?t=1184#p4082
</content>
</entry>
<entry>
<title>esp8266: Implement basic deep-sleep capabilities.</title>
<updated>2016-04-21T10:43:37+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-04-21T10:43:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=32d7cf6e441660caed00620309d1faa4b7df5dd4'/>
<id>urn:sha1:32d7cf6e441660caed00620309d1faa4b7df5dd4</id>
<content type='text'>
Use the machine.deepsleep() function to enter the sleep mode.  Use the
RTC to configure the alarm to wake the device.

Basic use is the following:

    import machine

    # configure RTC's ALARM0 to wake device from deep sleep
    rtc = machine.RTC()
    rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)

    # do other things
    # ...

    # set ALARM0's alarm to wake after 10 seconds
    rtc.alarm(rtc.ALARM0, 10000)

    # enter deep-sleep state (system is reset upon waking)
    machine.deepsleep()

To detect if the system woke from a deep sleep use:

    if machine.reset_cause() == machine.DEEPSLEEP_RESET:
        print('woke from deep sleep')
</content>
</entry>
<entry>
<title>esp8266: Add utime and pyb.RTC</title>
<updated>2015-05-12T23:12:54+00:00</updated>
<author>
<name>Josef Gajdusek</name>
<email>atx@atx.name</email>
</author>
<published>2015-05-11T19:11:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=103d12a877f09e5d812f8c9c1fbf13ddbea4f78c'/>
<id>urn:sha1:103d12a877f09e5d812f8c9c1fbf13ddbea4f78c</id>
<content type='text'>
</content>
</entry>
</feed>
