logo

openmv h7 plus 实例里面的代码 驱动舵机是出现问题

2021-03-29 21:57
H
hmxd
5fdaedb1-1963-40b7-90ae-bed8fb718ea1.png

这是main中编的代码

# Servo Shield Example.

#

# This example demonstrates the servo shield. Please follow these steps:

#

# 1. Connect a servo to any PWM output.

# 2. Connect a 3.7v battery (or 5V source) to VIN and GND.

# 3. Copy pca9685.py and servo.py to OpenMV and reset it.

# 4. Connect and run this script in the IDE.

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, 0)

time.sleep_ms(500)

servo.position(0, 180)

time.sleep_ms(500)

2021-03-30 18:11
I
网红小智智 星瞳科技

OpenMV的插针肯定要焊接的,没焊接用不了。https://singtown.com/learn/50057/