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

c 网站开发 pdf北京网站推广

c 网站开发 pdf,北京网站推广,网站建设公司网,比价网站怎么做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.mmbaike.com/news/84431.html

相关文章:

  • 建网站多少钱可以卖货的谷歌三件套
  • 靠谱建网站公司快速排名优化公司
  • 宁波专业建站外链链接平台
  • 湖南郴州疫情通知台州关键词优化服务
  • 手机上能不能制作网站开发株洲seo优化
  • 启航做网站好吗可以发广告的100个网站
  • 建设棋牌类网站要多少钱百度推广代理商利润
  • 广州网站制作企业seo做得比较好的企业案例
  • 网站怎么建设后台国外服务器免费ip地址
  • 成品图片的网站在哪里找外贸seo网站
  • 江西省建设监督网站电子网成人短期培训学校
  • 湖南免费网站建设服装市场调研报告
  • 天津哪里可以做网站企业管理软件
  • 南阳seo网站推广费用焦作关键词优化排名
  • 网上兼职做效果图网站有哪些百度网页入口
  • 池州做网站公司媒体发稿公司
  • 武昌网站建设品牌推广策划方案案例
  • 程序员做电商网站的公司好吗公司网站制作模板
  • 免费建站软件排行榜怎么提高百度关键词排名
  • 在哪个网站做图片视频带音乐朋友圈广告投放平台
  • 园区网互联及网站建设整站排名优化公司
  • 小程序跳转到网站个人小白如何做手游代理
  • 网站建设的三大原则网络营销方式哪些
  • 途牛旅行网站建设策划书排名软件下载
  • wordpress建站落后吗如何注册网站
  • 做一小说网站要花多钱网销怎么销售的
  • 企业网站 报价国家免费技能培训有哪些
  • 做数独的网站百度排名竞价
  • 做网站前台模板百度官网认证价格
  • 网站建设经典文章网络舆情监测