Servo Hat
SERVO HAT as the name suggests, is a servo motor module with the new and upgraded “ES9251II” digital servo,This comes with 145°±10° range of motion and can be controlled by PWM signals. The signal pin of the hat is connected to G26 on M5StickC.
Support the following products:
Micropython Example:
import os, sys, io
import M5
from M5 import *
from hardware import *
from hat import ServoHat
servo = ServoHat((26, 0))
servo.set_duty(100)
servo.set_percent(50)
UIFLOW2 Example:
class ServoHat
Constructors
Methods
- ServoHat.set_duty(duty: int) None
Set the duty cycle.
- 参数:
duty (int) – The duty cycle. from 26 to 127.
UIFLOW2:
- ServoHat.set_percent(percent: int) None
Set the clamping percentage.
- 参数:
percent (int) – The clamping percentage. from 0 to 100.
UIFLOW2:
- ServoHat.deinit()
Deinitialize the Servo.
UIFLOW2:
