• 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

Web Server Course Project 2.2 Question

Q&A Forum › Web Server Course Project 2.2 Question
0 Vote Up Vote Down
Edward Wilson asked 3 years ago

I am currently working my way through the Web Server course and have progressed to Project 2.2 Web Server Control Multiple Outputs (Toggle Switches). The project is working fine using the suggested 4 LEDs.

I am making some relatively minor modifications to the project to drive 4 relays. The relay module requires an active-LOW signal to turn the relays ON as opposed to an active-HIGH signal to illuminate the LEDs in the original version of the project. I seem to have figured out how obtain that active-LOW signal when I click the toggle switches appropriately, but the initial conditions are not to my liking.

When the ESP32 is first powered-up, all of the relays start in the active-LOW state which turns them ON. I would like to start with all relays active-HIGH or OFF. Also, I would like all relays to start in the OFF state when the client makes its first request to the server.

I am still in the process of trying to understand the software as presented in the course version of this project and would appreciate some hints on how I might implement modifications to the code to realize the circuit operation as described above.

Thanks in advance!

Ed Wilson

5 Answers
0 Vote Up Vote Down
Edward Wilson answered 3 years ago

Ignore

0 Vote Up Vote Down
Edward Wilson answered 3 years ago

Ignore

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

Hi Ed.
were you able to find out?
Regards.
Sara

0 Vote Up Vote Down
Edward Wilson answered 3 years ago

Sara,

I was able to set the relays to the OFF position upon power-up by inserting four digitalWrite (pin, HIGH); statements in the setup function part of main.cpp. I assume that I was able to do this since the cpp program had an #include <Arduino.h> header. Upon further reflection I decided that I did not want to reset all relays to the off position when I get a request from the client.

I guess that I have solved my problem, but not with the most “elegant” approach. You may mark this question as resolved…thanks.

Ed Wilson

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

Ok. Great!
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
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

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 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.