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

slider.mp4

Make the Slider

Autodesk Inventor Sketch

Add a motion sensor monitored by the NodeMCU8266

Here's the standard code:

  1. Assign pin names

  2. In the Setup section: assign input / output function.

  3. 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: