try: wifi.link("SSID",wifi.WIFI_WPA2,"PASSWORD") break except Exception as e: print("Can't link",e) else: print("Impossible to link!") while True: sleep(1000) # Start the Zerynth app instance! # Remember to create a template with the files under the "template" folder you just cloned # upload it to the ADM and associate it with the connected device zapp.run() # Read ADC and send values to the ADM while True: sleep(1000) x = (adc.read(A4)*100)//4096 zapp.event({"data":x}) if x>95: # send mobile notification # (there is a limit of one notification per minute per device on the ADM sandbox) zapp.notify("ALARM!","The value is greater than 95!") except Exception as e: print(e) 这个示例中,Zerynth将大年夜相连的电路板获取的数据改变成可视化的图情势波器,这些模仿传感器的数据经由过程“模仿”pin A4产生。
导入精确的wifi驱动法度榜样和传感器库
正如你在注释中看到的,示例是基于 粒子光子板 和wifi驱动的。想要应用WiFi Plus Click,必须修改以下几行:
- from broadcom.bcm43362 import bcm43362 as wifi_driver
- from microchip.mcw1001a import mcw1001a as wifi_driver
- wifi_driver.auto_init()
然后采取 WiFi PLUS Click 将电路板连接到互联网, WiFi PLUS Click 具有MRF24WB0MA-2.4GHz特点,能兼容IEEE std 802.11微芯片模块,并且是车袈湄TCP/IP栈和802.11连接治理器匹配的MCW1001的┞菲握器。
推荐阅读
3G关闭倒计时引发全网通换机潮?
5月5日消息,近日中国电信宣布一条通知布告:因收集进级和技巧更新,自2017年6月1日起,部分老旧手机终端用户>>>详细阅读
本文标题:基于Python和JavaScript编写物联网温度计程序
地址:http://www.17bianji.com/lsqh/35053.html
1/2 1