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.
Can you tell me the exact project that you are following and which GPIOs you are trying to control?
2.2 – Web Server – Control Multiple
Outputs (Toggle Switches)
Controlling 4 LEDs
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?
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/
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.
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:
Does your circuit works like this too?
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.