Catch Unit
Catch is a gripper that uses a SG92R servo as a power source. The servo uses a PWM signal to drive the gripper gear to rotate and control the gripper for clamping and releasing operations. The structure adopts a design compatible with Lego 8mm round holes. You can combine it with other Lego components to build creative control structures, such as robotic arms, gripper carts, etc.
Support the following products:
Micropython Example:
1# SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD 2# 3# SPDX-License-Identifier: MIT 4 5import os, sys, io 6import M5 7from M5 import * 8from unit import CatchUnit 9import time 10 11 12catch_0 = None 13 14 15import random 16 17 18def setup(): 19 global catch_0 20 21 M5.begin() 22 Widgets.fillScreen(0x222222) 23 24 catch_0 = CatchUnit((8, 9)) 25 26 27def loop(): 28 global catch_0 29 M5.update() 30 catch_0.set_clamp_percent(random.randint(1, 100)) 31 time.sleep_ms(100) 32 33 34if __name__ == "__main__": 35 try: 36 setup() 37 while True: 38 loop() 39 except (Exception, KeyboardInterrupt) as e: 40 try: 41 from utility import print_error_msg 42 43 print_error_msg(e) 44 except ImportError: 45 print("please update to latest firmware")
UIFLOW2 Example:
class CatchUnit
Constructors
Methods
- CatchUnit.set_duty(duty: int) None
Set the duty cycle.
- 参数:
duty (int) – The duty cycle. from 20 to 54.
UIFLOW2: