Data Sheet

21
Open the LuaLoader, click the “Upload File…”choo se ESP8 266 NodeM CU kit demo
code -> P9_Hall_Switch -> init.lua. After the upload completed then click “Download to
download the init.lua file.
Demo code:
while(1) do
a=gpio.read(1)
print (b)
tmr.delay(2000000) --delay 2s
if(a==1) then
gpio.write(2,gpio.HIGH)
else
gpio.write(2,gpio.LOW)
end
end
If there is a magnetic material approaching the hall sensor, the relay will start to work, on the
contrary, the relay will be disconnected. Just like a hall switch.
10. Lesson10 Breathing Lamp
In this lesson, we through adjust the Rotary Angle Sensor to control the PWM output then
control the brightness of LEDwhich could be a breathing lamp.
Material:
Crowtail- ESP8266 NodeMCU x 1
Crowtail- Rotary Angle Sensor
Crowtail- LED
Hardware Connection