• 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

ESP WEB SERVER – Control Multiple Outputs

Q&A Forum › Category: ESP8266 › ESP WEB SERVER – Control Multiple Outputs
0 Vote Up Vote Down
Bob Dehn asked 2 years ago

When I built the Control multiple output project, I was able to get the project to work, however, my outputs on the webpage are opposite than the state of the GPIO state.
The website shows the output as off when the LEDs are lit. and when I set the switch to on the led goes off.
Advice on correcting this issue would be appreciated.
 
Thanks
 

9 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
Can you tell me the exact project that you are following and which GPIOs you are trying to control?
Regards,
Sara

0 Vote Up Vote Down
Bob Dehn answered 2 years ago

2.2 – Web Server – Control Multiple
Outputs (Toggle Switches)

Controlling 4 LEDs

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

Does that happen with all GPIOs?

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

I have just tested the code provided in the project folder and everything is working as expected.
What is the ESP8266 board that you are using?
Regards,
Sara

0 Vote Up Vote Down
Bob Dehn answered 2 years ago

Yes, all GPIO pins are affected. The image on page 226 of the book shows the problem. I have included the image here. All switches on the website show state of off when the LEDs are lit. and when the switches are changed the LEDs go off the switched state is ON/

0 Vote Up Vote Down
Bob Dehn answered 2 years ago

I am using NedeMCU esp8266. Images in the book also demonstrate the issue. The switches say “Off” but the LED is on. This seems backward.

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

Hi.
I’m sorry but I don’t understand…
When the button is red, it means that the LED is on. If you click on the red button, it will change color to gray and send the command to turn off the LED.
Maybe the image is a bit confusing.
However, the example works fine for me. Watch the video:

  • https://bit.ly/3pnnO1U

Does your circuit works like this too?
Regards,
Sara
 

0 Vote Up Vote Down
Bob Dehn answered 2 years ago

Ok, I have watched the video. The operation of the circuit in the video is what I would expect the circuit to operate. My circuit does not operate in the same manner. the status of the switches are OFF and the LED’s are on. when the LED’s are opff the Switches are on. Your circuit is operating correctly. Mine is backwards.

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

That’s really weird. 
I guess it must be something related with your board.
To make it operate properly for you, you’ll have to switch the 1 with the 0 in the requests.
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.