-
dcexpert 发表于 2018-1-25 13:50
检查一下连接,看起来是没有找到芯片,rom是空的,所以出错
连接是好的
-
为什么我的会报错:
Traceback (most recent call last):
File "main.py", line 8, in
TypeError: function takes 2 positional arguments but 1 were given
这是我的main.py
[Python] 纯文本查看 复制代码
?
01
02
03
04
05
06
07
08
09
10
from pyb import Pin
from ds18x20 import DS18X20
Pin("Y11",Pin.OUT_PP).low()#GND
Pin("Y9",Pin.OUT_PP).high()#VCC
pyb.delay(100)
DQ=DS18X20(Pin('Y10'))#DQ
while True:
tem = DQ.read_temp()
print(tem)
pyb.delay(1000)
-
为什么我的会报错:
Traceback (most recent call last):
File "main.py", line 8, in
TypeError: function takes 2 positional arguments but 1 were given
这是我的main.py
from pyb import Pin
from ds18x20 import DS18X20
Pin("Y11",Pin.OUT_PP).low()#GND
Pin("Y9",Pin.OUT_PP).high()#VCC
pyb.delay(100)
DQ=DS18X20(Pin('Y10'))#DQ
while True:
tem = DQ.read_temp()
print(tem)
pyb.delay(1000)
复制代码
-
File "main.py", line 10, in
TypeError: function takes 2 positional arguments but 1 were given
#main.py
import pyb
from pyb import Pin
from ds18x20 import DS18X20
Pin("Y11",Pin.OUT_PP).low()#GND
Pin("Y9",Pin.OUT_PP).high()#VCC
pyb.delay(100)
DQ=DS18X20(Pin('Y10'))#DQ
while True:
tem = DQ.read_temp()
print(tem)
pyb.delay(1000)
复制代码
-
学习
-
apple01 发表于 2018-1-4 17:47
谢谢推荐
程序太大的,下载时容易卡24.9%