MQTT + Flask Server(Raspberry PI) + nodeMCU를 이용한 IoT 제작
function onLED (){
// location.href = "light/ledon";
location . href = "/nodemcu.iot.csee/1/light/ledon" ;
}
function offLED (){
// location.href = "light/ledoff";
location . href = "/nodemcu.iot.csee/1/light/ledoff" ;
}
function toggleLED (){
location . href = "/nodemcu.iot.csee/1/light/led" ;
}
function onUSBLED (){
location . href = "/nodemcu.iot.csee/1/light/usbledon" ;
}
function offUSBLED (){
location . href = "/nodemcu.iot.csee/1/light/usbledoff" ;
}
function toggleUSBLED (){
location . href = "/nodemcu.iot.csee/1/light/usbled" ;
}
< /script>
/head>
실전 프로젝트 IoT
MQTT를 이용한 nodemcu 컨트롤
Home으로 이동
LED 켜고 끄기 ver2
LED On
LED Off
LED Toggle
{% if flag == 1 %}
led on
{% else %}
led off
{% endif %}
USB LED 켜고 끄기 - 1217 오후ver
USB LED On
USB LED Off
USB LED Toggle
{% if flag2 == 1 %}
usb led on
{% else %}
usb led off
{% endif %}
$ (
function (){
$ ( "#toggle_led" ). change ( function (){
window . location . href = "/led" ;
}
)
}
)
< /script>
from http://covenant.tistory.com/72 by ccl(A) rewrite - 2020-03-06 09:54:18
댓글
댓글 쓰기