logo

machine vs pyb

2021-08-15 22:17
D
qsgp

请教一下,为啥运行下面这个简单代码会出现这个错误:

TypeError: can't convert 'int' object to str implicitly

不是说 openMV 里 已经 用 machine 替代 pyb 了吗?

代码:

import sensor, image, time

from machine import Pin

p0=Pin(0, Pin.OUT)

2021-08-16 16:41
I
网红小智智 星瞳科技

改为

import sensor, image, time
from machine import Pin

p0=Pin("P0", Pin.OUT)