1、微信小程序
小程序的一种,英文名Wechat Mini Program,是一种不需要下载安装即可使用的应用,它实现了应用“触手可及”的梦想,用户扫一扫或搜一下即可打开应用。全面开放申请后,主体类型为企业、政府、媒体、其他组织或个人的开发者,均可申请注册小程序。微信小程序、微信订阅号、微信服务号、微信企业号是并行的体系。
微信小程序是一种不用下载就能使用的应用,也是一项创新,经过将近两年的发展,已经构造了新的微信小程序开发环境和开发者生态。微信小程序也是这么多年来中国IT行业里一个真正能够影响到普通程序员的创新成果,已经有超过150万的开发者加入到了微信小程序的开发,与我们一起共同发力推动微信小程序的发展,微信小程序应用数量超过了一百万,覆盖200多个细分的行业,日活用户达到两个亿,微信小程序还在许多城市实现了支持地铁、公交服务。微信小程序发展带来更多的就业机会,2017年小程序带动就业104万人,社会效应不断提升。
2017年1月9日,张小龙在2017微信公开课Pro上发布的微信小程序正式上线。2018年2月,微信官方发布公告称:已对涉及假货高仿、色情低俗和违规“现金贷”等超过2000个微信小程序,进行永久封禁处理。2019年8月9日,微信向开发者发布新能力公测与更新公告,微信PC版新版本中,支持打开聊天中分享的微信小程序。
本帖最后由 eagler8 于 2020-6-2 15:39 编辑
目录清单
MicroPython动手做(01)——春节后入手了一块K210芯片AI开发板
https://bbs.eeworld.com.cn/thread-1115786-1-1.html
MicroPython动手做(02)——尝试搭建K210开发板的IDE环境
https://bbs.eeworld.com.cn/thread-1115831-1-1.html
MicroPython动手做(03)——零基础学MaixPy之开机运行
https://bbs.eeworld.com.cn/thread-1116184-1-1.html
MicroPython动手做(04)——零基础学MaixPy之基本示例
https://bbs.eeworld.com.cn/thread-1116438-1-1.html
MicroPython动手做(05)——零基础学MaixPy之LCD液晶屏
https://bbs.eeworld.com.cn/thread-1116577-1-1.html
MicroPython动手做(06)——零基础学MaixPy之单目摄像头
https://bbs.eeworld.com.cn/thread-1116591-1-1.html
MicroPython动手做(07)——零基础学MaixPy之机器视觉
https://bbs.eeworld.com.cn/thread-1116617-1-1.html
MicroPython动手做(08)——零基础学MaixPy之识别颜色
https://bbs.eeworld.com.cn/thread-1116662-1-1.html
MicroPython动手做(09)——零基础学MaixPy之人脸识别
https://bbs.eeworld.com.cn/thread-1116720-1-1.html
MicroPython动手做(10)——零基础学MaixPy之神经网络KPU
https://bbs.eeworld.com.cn/thread-1116925-1-1.html
MicroPython动手做(11)——搭建掌控板IDE环境
https://bbs.eeworld.com.cn/thread-1117964-1-1.html
MicroPython动手做(12)——掌控板之Hello World
https://bbs.eeworld.com.cn/thread-1118180-1-1.html
MicroPython动手做(13)——掌控板之RGB三色灯
https://bbs.eeworld.com.cn/thread-1118275-1-1.html
MicroPython动手做(14)——掌控板之OLED屏幕
https://bbs.eeworld.com.cn/thread-1118389-1-1.html
MicroPython动手做(15)——掌控板之AB按键
https://bbs.eeworld.com.cn/thread-1118496-1-1.html
MicroPython动手做(16)——掌控板之图片图像显示
https://bbs.eeworld.com.cn/thread-1118945-1-1.html
MicroPython动手做(17)——掌控板之触摸引脚
https://bbs.eeworld.com.cn/thread-1119462-1-1.html
MicroPython动手做(18)——掌控板之声光传感器
https://bbs.eeworld.com.cn/thread-1119583-1-1.html
MicroPython动手做(19)——掌控板之蜂鸣器与音乐
https://bbs.eeworld.com.cn/thread-1119668-1-1.html
MicroPython动手做(20)——掌控板之三轴加速度
https://bbs.eeworld.com.cn/thread-1119998-1-1.html
MicroPython动手做(21)——掌控板之磁场传感器
https://bbs.eeworld.com.cn/thread-1120188-1-1.html
MicroPython动手做(22)——掌控板之无线广播
https://bbs.eeworld.com.cn/thread-1120835-1-1.html
MicroPython动手做(23)——掌控板之WiFi与蓝牙
https://bbs.eeworld.com.cn/thread-1120934-1-1.html
MicroPython动手做(24)——掌控板之拓展掌控宝
https://bbs.eeworld.com.cn/thread-1121208-1-1.html
MicroPython动手做(25)——语音合成与语音识别
https://bbs.eeworld.com.cn/thread-1123752-1-1.html
MicroPython动手做(26)——物联网之OneNET
https://bbs.eeworld.com.cn/thread-1125172-1-1.html
MicroPython动手做(27)——物联网之微信小程序
https://bbs.eeworld.com.cn/thread-1125520-1-1.html
MicroPython动手做(28)——物联网之Yeelight
https://bbs.eeworld.com.cn/thread-1125939-1-1.html
MicroPython动手做(29)——物联网之SIoT
https://bbs.eeworld.com.cn/thread-1126090-1-1.html
4、登录小程序“掌控板物联网”
#MicroPython动手做(27)——物联网之微信小程序
#登录小程序“掌控板物联网”
#MicroPython动手做(27)——物联网之微信小程序
#登录小程序“掌控板物联网”
from mpython import *
import network
from umqtt.simple import MQTTClient
from machine import Timer
import machine
import ubinascii
my_wifi = wifi()
my_wifi.connectWiFi("zh", "zy1567")
def OneNET_recv(_msg):pass
_OneNET_msg_list = []
def OneNET_callback(_topic, _msg):
global _OneNET_msg_list
try: _msg = _msg.decode('utf-8', 'ignore')
except: print(_msg);return
OneNET_recv(_msg)
if _msg in _OneNET_msg_list:
eval('OneNET_recv_' + bytes.decode(ubinascii.hexlify(_msg)) + '()')
tim14 = Timer(14)
_iot_count = 0
def timer14_tick(_):
global _iot, _iot_count
_iot_count = _iot_count + 1
if _iot_count == 1000: _iot.ping(); _iot_count = 0
try: _iot.check_msg()
except: machine.reset()
_iot = None
def OneNET_setup():
global _iot
_iot = MQTTClient("595250725", "183.230.40.39", 6002, "221628", "hiN7Cwz4Gd7d3ReMnNgtaEKBvv4=", keepalive=300)
_iot.set_callback(OneNET_callback)
if 1 == _iot.connect(): print('Successfully connected to MQTT server.')
tim14.init(period=200, mode=Timer.PERIODIC, callback=timer14_tick)
OneNET_setup()
#MicroPython动手做(27)——物联网之微信小程序
#尝试通过小程序来控制板载RGB灯
#MicroPython动手做(27)——物联网之微信小程序
#尝试通过小程序来控制板载RGB灯
from mpython import *
import network
import time
from umqtt.simple import MQTTClient
from machine import Timer
import machine
import ubinascii
import ujson
my_wifi = wifi()
my_wifi.connectWiFi("zh", "zy1567")
def OneNET_recv(_msg):pass
_OneNET_msg_list = []
def OneNET_callback(_topic, _msg):
global _OneNET_msg_list
try: _msg = _msg.decode('utf-8', 'ignore')
except: print(_msg);return
OneNET_recv(_msg)
if _msg in _OneNET_msg_list:
eval('OneNET_recv_' + bytes.decode(ubinascii.hexlify(_msg)) + '()')
tim14 = Timer(14)
_iot_count = 0
def timer14_tick(_):
global _iot, _iot_count
_iot_count = _iot_count + 1
if _iot_count == 1000: _iot.ping(); _iot_count = 0
try: _iot.check_msg()
except: machine.reset()
_iot = None
def OneNET_setup():
global _iot
_iot = MQTTClient("595250725", "183.230.40.39", 6002, "221628", "hiN7Cwz4Gd7d3ReMnNgtaEKBvv4=", keepalive=300)
_iot.set_callback(OneNET_callback)
if 1 == _iot.connect(): print('Successfully connected to MQTT server.')
tim14.init(period=200, mode=Timer.PERIODIC, callback=timer14_tick)
def OneNET_recv(_msg):
try:
_msgObj = ujson.loads(_msg)
_name = _msgObj.get('name')
_value = _msgObj.get('value')
except: return
if _name == "开灯":
print(_value)
rgb.fill((int(255), int(0), int(0)))
rgb.write()
time.sleep_ms(1)
if _name == "关灯":
print(_value)
rgb.fill( (0, 0, 0) )
rgb.write()
time.sleep_ms(1)
rgb[1] = (int(0), int(102), int(0))
rgb.write()
time.sleep_ms(1)
OneNET_setup()
6、小程序控制RGB灯升级版
#MicroPython动手做(27)——物联网之微信小程序
#小程序控制RGB灯升级版
from mpython import *
import network
import time
from umqtt.simple import MQTTClient
from machine import Timer
import machine
import ubinascii
import ujson
import music
my_wifi = wifi()
my_wifi.connectWiFi("zh", "zy1567")
def OneNET_recv(_msg):pass
_OneNET_msg_list = []
def OneNET_callback(_topic, _msg):
global _OneNET_msg_list
try: _msg = _msg.decode('utf-8', 'ignore')
except: print(_msg);return
OneNET_recv(_msg)
if _msg in _OneNET_msg_list:
eval('OneNET_recv_' + bytes.decode(ubinascii.hexlify(_msg)) + '()')
tim14 = Timer(14)
_iot_count = 0
def timer14_tick(_):
global _iot, _iot_count
_iot_count = _iot_count + 1
if _iot_count == 1000: _iot.ping(); _iot_count = 0
try: _iot.check_msg()
except: machine.reset()
_iot = None
def OneNET_setup():
global _iot
_iot = MQTTClient("595250725", "183.230.40.39", 6002, "221628", "hiN7Cwz4Gd7d3ReMnNgtaEKBvv4=", keepalive=300)
_iot.set_callback(OneNET_callback)
if 1 == _iot.connect(): print('Successfully connected to MQTT server.')
tim14.init(period=200, mode=Timer.PERIODIC, callback=timer14_tick)
image_picture = Image()
def OneNET_recv(_msg):
try:
_msgObj = ujson.loads(_msg)
_name = _msgObj.get('name')
_value = _msgObj.get('value')
except: return
if _name == "开灯":
print(_value)
music.play('B5:1')
rgb.fill((int(255), int(0), int(0)))
rgb.write()
time.sleep_ms(1)
oled.fill(0)
oled.blit(image_picture.load('face/Objects/Light on.pbm', 0), 32, 0)
oled.show()
if _name == "关灯":
print(_value)
music.play('E5:1')
rgb.fill( (0, 0, 0) )
rgb.write()
time.sleep_ms(1)
oled.fill(0)
oled.blit(image_picture.load('face/Objects/Light off.pbm', 0), 32, 0)
oled.show()
rgb[1] = (int(0), int(102), int(0))
rgb.write()
time.sleep_ms(1)
OneNET_setup()
#MicroPython动手做(27)——物联网之微信小程序
#小程序控制RGB灯升级版(实验小视频)
https://v.youku.com/v_show/id_XNDY5NzE5MTIxMg==.html?spm=a2h0c.8166622.PhoneSokuUgc_1.dtitle