peter3 发表于 2019-1-3 11:30:12

当掌控遇上Blynk(2)——远程控制七彩灯

本帖最后由 rzyzzxw 于 2019-1-8 21:08 编辑











import network,BlynkLib,time
from mpython import *
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
if not wlan.isconnected():
print('connecting to network...')
wlan.connect('Maker Space', '12345678')   #wifi信息
while not wlan.isconnected():
    pass
print('network config:', wlan.ifconfig())#输出wifi连接信息
BLYNK_AUTH = 'a7bdb2d016d74e839f96660bf******'#Blynk授权码
blynk = BlynkLib.Blynk(BLYNK_AUTH)# 初始化Blynk连接
@blynk.VIRTUAL_WRITE(0)
def v0_write_handler(value):#从Blnyk的V0管脚获取到value,value是一个list类型
      rgb = (int(value),int(value),int(value))
      rgb = (int(value),int(value),int(value))
      rgb = (int(value),int(value),int(value)) # 获取到三个颜色值,并从str转成int型
      rgb.write()
while True:
      blynk.run()#一直运行blynk
      pass
https://v.qq.com/x/page/w0823pfxp23.html


rzyzzxw 发表于 2019-1-3 18:49:32

我也跟上。{:5_148:}

铁熊 发表于 2019-1-3 11:32:58

前排支持

peter3 发表于 2019-1-3 12:50:28

铁熊 发表于 2019-1-3 11:32
前排支持

:P

44107900 发表于 2019-1-3 17:29:19

谢谢楼主分享!

zqzxwdm 发表于 2019-4-10 00:05:04

run program...
exec(open('mixly.py').read(),globals())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1, in <module>
ImportError: no module named 'BlynkLib'
>>>

出现这些错误信息,请问哪里出错了

peter3 发表于 2019-4-21 19:29:14

zqzxwdm 发表于 2019-4-10 00:05
run program...
exec(open('mixly.py').read(),globals())
Traceback (most recent call last):


你没有BlynkLib库

醉鲸未归 发表于 2019-5-23 13:14:31

write file mixly.py...
Timeout: Serial has no response! Now retry...
========> done!
NOTICE: mixly_tool.py is the same in board, now skip it!
NOTICE: BlynkLib.py is the same in board, now skip it!
write file mpython.py...
========> done!
NOTICE: reset.py is the same in board, now skip it!
machine reseting...
========> done!
set main.py...
========> done!
run program...
exec(open('mixly.py').read(),globals())

    _____          __
   / _ )/ /_ _____/ /__
/ _/ / // / _ \/'_/
/____/_/\_, /_//_/_/\_\
      /___/ for Python v0.2.0

[0;32mI (2722) phy: phy_version: 3910, c0c45a3, May 21 2018, 18:07:06, 0, 0[0m
connecting to network...
network config: ('172.19.233.23', '255.255.0.0', '172.19.233.1', '172.19.233.1')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 12, in <module>
File "BlynkLib.py", line 211, in __init__
File "BlynkLib.py", line 57, in __init__
TypeError: function takes 2 positional arguments but 1 were given
>>>

请问出现了这种问题该怎么修改?

1909425849 发表于 2019-7-2 14:45:09

我想请问一下你的编译软件是Mixly,这是一款不常用的软件,我们应该如何去安装呢?

1909425849 发表于 2019-7-3 15:32:09




我已经对该项进行了配置,为什么还是不能找到BlynkLib

gada888 发表于 2019-7-13 14:49:08

Blynk能这么玩的。没想到

glwz007 发表于 2019-11-24 08:54:22

谢谢分享
页: [1]
查看完整版本: 当掌控遇上Blynk(2)——远程控制七彩灯