当前位置: 首页 > news >正文

珠海企业集团网站建设百度集团

珠海企业集团网站建设,百度集团,固原网站建设,wordpress 目录下拉框Ciso声明:本篇文章基于使用腾讯云物联网平台连接自定义esp8266物联网设备(腾讯连连控制开关实现) - CSDN App改编 一、总体概览 功能描述: 使用腾讯连连小程序进行控制, Alarm(警铃):开的时候&#xff…

Ciso声明:本篇文章基于使用腾讯云物联网平台连接自定义esp8266物联网设备(腾讯连连控制开关实现) - CSDN App改编

一、总体概览

功能描述:

使用腾讯连连小程序进行控制,

Alarm(警铃):开的时候,亮红灯;关的时候关闭。

RGB LED(三色灯):有4个属性值,Red,Green,Blue,OFF,分别对应红灯,绿灯,蓝灯,关闭。

Fan(风扇):有3个属性值,OFF,Low,High,分别对应关闭、一档、二档。

MCU(单片机):控制这三个设备

二、Ciso模拟器部分

MCU(单片机编程):

from realudp import *

from time import *

from gpio import *

from options import Options

from time import *

import math

from physical import *

from gpio import *

from environment import Environment

from ioeclient import IoEClient

IP = "127.0.0.1"

PORT = 1834

switchStatus="0"

colorStr="0"

colorID =3

bright =1023

fengShanControl="0"

#from pyjs import *

def onLedRGB(rgb):

if rgb==0:

#digitalWrite(1,HIGH)

#digitalWrite(2,LOW)

#digitalWrite(3,LOW)

analogWrite(1,bright)

analogWrite(2,0)

analogWrite(3,0)

if rgb==1:

#digitalWrite(1,LOW)

#digitalWrite(2,HIGH)

#digitalWrite(3,LOW)

analogWrite(1,0)

analogWrite(2,bright)

analogWrite(3,0)

if rgb==2:

#digitalWrite(1,LOW)

#digitalWrite(2,LOW)

#digitalWrite(3,HIGH)

analogWrite(1,0)

analogWrite(2,0)

analogWrite(3,bright)

if rgb==3:

digitalWrite(1,LOW)

digitalWrite(2,LOW)

digitalWrite(3,LOW)

def onUDPReceive(ip, port, data):

global colorStr

global switchStatus

global colorID

global bright

global fengShanControl

print("received from "

+ ip + ":" + str(port) + ":" + data);

data2 = data.split('{')[2].split('}')[0]

print("data2:  "+data2)

for i in range(0,len(data2)):

if( data2[i] == 's' and data2[i+1] == 'w'):

switchStatus = data2[i+8]

print("switchStatus = "+switchStatus)

if( data2[i] == 'c' and data2[i+1] == 'o'):

colorStr = data2[i+7]

print("colorStr = "+colorStr)

if( data2[i] == 'f' and data2[i+1] == 'e'):

fengShanControl = data2[i+10]

print("fengShanControl = "+fengShanControl)

if "0" in colorStr:

colorID = 0

onLedRGB(colorID)

if "1" in colorStr:

colorID = 1

onLedRGB(colorID)

if "2" in colorStr:

colorID = 2

onLedRGB(colorID)

if "3" in colorStr:

colorID = 3

onLedRGB(colorID)

if "0" in switchStatus:

digitalWrite(4,LOW)

#client.send("Alarm Closed!")

if "1" in switchStatus:

digitalWrite(4,HIGH)

#client.send("Alarm Opened!")

if "0" in fengShanControl:

customWrite(0,"0")

if "1" in fengShanControl:

customWrite(0,"1")

if "2" in fengShanControl:

customWrite(0,"2")

def main():

socket = RealUDPSocket()

socket.onReceive(onUDPReceive)

print(socket.begin(1834))

pinMode(1,OUT)

pinMode(2,OUT)

pinMode(3,OUT)

pinMode(4,OUT)

count = 0

while True:

# count += 1

# socket.send(IP, PORT, "hello " + str(count))

sleep(1)

if __name__ == "__main__":

main()

三、腾讯云物联网开发平台

参考链接里的博客

四、腾讯连连小程序

扫描腾讯云的二维码即可

五、演示视频

http://www.hkea.cn/news/60798/

相关文章:

  • 弥勒网站设计公司share群组链接分享
  • 网站建设栏目管理百度推广搜索排名
  • 企业管理类的网站全球搜是什么公司
  • 网站开发自我介绍seo报告
  • 网站应用软件设计海口seo网络公司
  • 武汉站建设深圳网站开发制作
  • 网站建设的平台分析北京seo技术
  • 手表价格网站百度推广天津总代理
  • 如何将域名和网站绑定排名seo怎么样
  • 旅游网站推广方案色盲测试图
  • 现在开发个网站多少钱安全优化大师
  • 网站开发工程师工资多少百度统计工具
  • 征信报告优化大师好用吗
  • 一个ip地址做多个网站网络营销公司是做什么的
  • 赤峰网站建设公司旅行网站排名
  • seo网站优化工具软件拉新推广平台
  • 政府网站设计方案无锡网站制作优化
  • 社交网站盈利吗如何在各种网站投放广告
  • 建设工程合同民法典东莞快速优化排名
  • 泗县口碑营销互联网营销推荐咨询青岛seo计费
  • 做电影网站用什么服务器中文域名注册官网入口
  • 做网站那里好win10系统优化工具
  • 做外贸上哪些网站找客户口碑营销的概念是什么
  • 外贸建站magento百度地图推广
  • 做网站和管理系统全网热度指数
  • 网站的压力测试怎么做网络营销的目的是什么
  • 网站建设如何更加稳定seo优化前景
  • 网站速度诊断 慢seo chinaz
  • 企业网站建设合同搜索引擎优化关键词的处理
  • 做翻译的网站私人做网站