• 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

ExternalWakeUp_ext_with_GPIO code question

Q&A Forum › Category: ESP32 › ExternalWakeUp_ext_with_GPIO code question
0 Vote Up Vote Down
x3mvz5pl5g5k asked 3 years ago

Could you explain in a little more detail how the following two statements work in the ExternalWakeUp_ext_with_GPIO program?

esp_sleep_wakeup_cause_t wakeup_reason;
wakeup_reason = esp_sleep_get_wakeup_cause();

Not sure what is going on in the first, whereas the second statement seems to save the output of a library function to a (undefined) data type?  I am still learning c and python, so appreciate a little help.

1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.

In simple words, the first sentence creates a variable called wakeup_reason of type esp_sleep_wakeup_cause_t.

This type of variable can save the output of the esp_sleep_get_wakeup_cause() function. This function returns what caused the ESP32 to wake up.

I hope this helps.
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] Firebase Web App with ESP32 and ESP8266 (version 1.2) April 25, 2022
  • [eBook Updated] MicroPython Programming with ESP32 and ESP8266 (version 1.3) February 7, 2022

You must be logged in to view this content.

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

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