• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Deep Sleep – using main.py

Q&A Forum › Category: ESP8266 › Deep Sleep – using main.py
0 Vote Up Vote Down
timhuffam asked 4 years ago

Just doing the section on Deep Sleep.  The book says to put the code into boot.py.   Is there any reason why I couldn’t put the code in main.py?
The reason I ask.. is that I have quite a bit of code (for rendering a display on an OLED) and I also want to check for user input (my deepsleep would only be 250ms).
 
Thanks.
Tim

Question Tags: DeepSleep
1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi Tim.
We say to put the code in the boot.py, because when you develop a deep sleep project, the code only runs once. There is no loop because it goes to sleep.
But you can put your code in main.py without any problem. 
I hope this answers you question,
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] SMART HOME with RPi, ESP32, and ESP8266 (version 1.2) March 8, 2023
  • [eBook Updated] ESP32-CAM Projects (version 1.3) January 7, 2023

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2023 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.