Slider Light Control
How to make a Slider Light Control
How to make a Slider Light Control
Demo: Pass your hand over the SLIDER activating a device. Is this case the fish tank lamp

Make the Slider
Make the Slider
Autodesk Inventor Sketch
Add a motion sensor monitored by the NodeMCU8266
Add a motion sensor monitored by the NodeMCU8266
Here's the standard code:
Assign pin names
In the Setup section: assign input / output function.
In the loop section: detect motion; read the current state of the output from a string; switch the output to the opposite state:
On my Fish Tank project, instead motion turns the light on. A timer turns the lamp off again, shown here it turns off after running through the loop 5 times: