• 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 6 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 6 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] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

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

Copyright © 2013-2025 · 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.