• 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

Merge code…

Q&A Forum › Category: ESP32 › Merge code…
0 Vote Up Vote Down
Gustavo Santoro dos Santos asked 5 years ago

How can I use two exemples in ESP32?
For example I have a code with LED with webserver ( Módule 4 Unit 2) and wanna make store value of the state of the LED ( Módule 2 Unit 7) .
 
Can I just fuse the sections of the two codes ?
( Outside the LOOP with Outside the LOOP , and  Inside the LOOP with Inside the LOOP )

Question Tags: code merge fuse
3 Answers
0 Vote Up Vote Down
SDBURTON answered 5 years ago

In general, you are taking the right approach. Start with the #include and global variable section. Check the setup() items and merge them together, being watchful of GPIO confilcts which may need to be updated for your board.  The Loop() section can be merged also, but you may need to make considerations for and delay() or sleep() calls involved.

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi Gustavo.
That’s exactly what SDBurton said. Also, pay attention to variable definitions that may conflict.
Try it for yourself and see what you get. If you get any errors or weird behavior and need some help, just ask. I’ll do my best to help you out.
Regards,
Sara

0 Vote Up Vote Down
Gustavo Santoro dos Santos answered 5 years ago

Thanks Folks !

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.