So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By victorvital100
#79264 Hello guys, how can I stop process with http get?

For example, I make a LED blinking with wifiserver but I want to turn it off, but when the loop starts, page is disable, how can I run these infinite loops in the background but accept another request?
User avatar
By noodlesuk
#79341 I guess you're blinking the LED using a delay? This ties up the processor and means it cannot check for other HTTP requests to turn the LED off, or keep on.

What you need to do is keep checking for clients/requests every so often and control the LED, sort of multitasking. You can do this by using a counter, or the system clock, in brief what you would do is:-

Loop Start
Check for HTTP requests, process as required
If LED should be flashing AND <0.5s has elapsed, turn LED off
If LED should be flashing AND <1s has elapsed, turn LED on
Loop end

For a general guide see - https://www.allaboutcircuits.com/projec ... is-lesson/