main.py

# Questo lavoro è concesso in licenza MIT.
# Copyright (c) 2013-2023 OpenMV LLC. Tutti i diritti riservati.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# Esempio di shield servo.
#
# Questo esempio dimostra lo shield servo. Seguire questi passaggi:
#
# 1. Collegare un servo a qualsiasi uscita PWM.
# 2. Collegare una batteria da 3,7V (o una sorgente da 5V) a VIN e GND.
# 3. Copiare pca9685.py e servo.py su OpenMV e riavviarlo.
# 4. Collegarsi ed eseguire questo script nell'IDE.

import time
from servo import Servos
from machine import SoftI2C, Pin

i2c = SoftI2C(sda=Pin("P5"), scl=Pin("P4"))
servo = Servos(i2c, address=0x40, freq=50, min_us=650, max_us=2800, degrees=180)

while True:
    for i in range(0, 8):
        servo.position(i, 0)
    time.sleep_ms(500)
    for i in range(0, 8):
        servo.position(i, 180)
    time.sleep_ms(500)

results matching ""

    No results matching ""