Hello, I have been away from OpenMV for some time, busy with other projects, but I finally found an excuse to get back to it. This is that excuse:
It’s a variation on my project Fluffbug, but using an OpenMV board for its brains.
I have the hardware pretty much assembled, but to tune it and test it, I need to get the servos working. I use the same PCA9685 chip as the servo shield, so I assumed it should be pretty straightforward. I started by just using the example code, but it doesn’t work. It seems like my board doesn’t even run main.py, and when I try to run it manually by importing it from the REPL, I get a timeout. So I tried to do a scan of the I2C bus, to make sure the address is correct, and it seems I can’t even get I2C working? Neither the example for the servos, nor the examples from the documentation seem to work:
MicroPython: v1.18-omv-r6 OpenMV: v4.3.1 HAL: v1.2.8 BOARD: OPENMV3-STM32F765
Type "help()" for more information.
>>> from machine import I2C, Pin
>>> i2c = I2C(sda=Pin('P5'), scl=Pin('P4'))
Warning: I2C(-1, ...) is deprecated, use SoftI2C(...) instead
>>> i2c = I2C(0, sda=Pin('P5'), scl=Pin('P4'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: I2C(0) doesn't exist
>>> i2c = I2C(1, sda=Pin('P5'), scl=Pin('P4'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: I2C(1) doesn't exist
>>> i2c = I2C()
Warning: I2C(-1, ...) is deprecated, use SoftI2C(...) instead
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'scl' argument required
What am I doing wrong?