Servo2 Module

SERVO 2 is an updated servo driver module in the M5Stack stackable module series. It uses a PCA9685 16 channel PWM controller to control 16 channel servos at the same time. The power input is 6-12V DC and two SY8368AQQC chips are used for voltage reduction.

Support the following products:

Servo2Module

Micropython Example:

import os, sys, io
import M5
from M5 import *
from module import Servo2Module
servo = Servo2Module()
servo.position(0, degrees=90)
servo.release()

UIFLOW2 Example:

example.png

class Servo2Module

Constructors

class Servo2Module(address, freq, min_us, max_us, degrees)

Create a Servo instance.

Parameters:
  • address (int) – The I2C address.

  • freq (int) – The PWM frequency in Hz.

  • min_us (int) – The minimum pulse width in microseconds.

  • max_us (int) – The maximum pulse width in microseconds.

  • degrees (int) – The maximum angle in degrees.

UIFLOW2:

init.png

Methods

Servo2Module.position(index, degrees, radians, us, duty)

Set the servo position.

Parameters:
  • index – The channel index.

  • degrees – The angle in degrees.

  • radians – The angle in radians.

  • us – The pulse width in microseconds.

  • duty – The duty cycle in percent.

UIFLOW2:

set_degrees.png

set_duty.png

set_pulse_width.png

set_radians.png

Servo2Module.release(index)

Release the servo.

Parameters:

index – The channel index.

UIFLOW2:

release.png