舵机驱动,运行代码显示I2C弃用,咋改。
-
import time from servo import Servos from machine import I2C, Pin i2c = I2C(sda=Pin('P5'), scl=Pin('P4')) servo = Servos(i2c, address=0x40, freq=50, min_us=500, max_us=2500, degrees=180) while True: servo.position(0, 180) time.sleep_ms(1000) servo.position(0, 180) time.sleep_ms(1000)
-
只是warning,不影响使用。