import time from Arm_Lib import Arm_Device # Get DOFBOT object Arm = Arm_Device() time.sleep(.1) # Separately control a servo to move to a certain angle id = 5 #print("Move Servo 5 to 90") #Arm.Arm_serial_servo_write(4, 90, 500) time.sleep(1) # Separately control a servo to move to a certain angle id = 5 #print("Move Servo 5 to 180") #Arm.Arm_serial_servo_write(id, 180, 5) time.sleep(1) # Control a servo to switch angles id = 5 def main(): for i in range(5): Arm.Arm_serial_servo_write(2, 60, 500) Arm.Arm_serial_servo_write6(45, 45, 45, 45, 45, 45, 0) ServoAngle = Arm.Arm_serial_servo_read(i + 1) print("Adjusting Servo ", i + 1) while ServoAngle not in range(44, 47): Arm.Arm_serial_servo_write(i + 1, 45, 0)
import time from Arm_Lib import Arm_Device import paho.mqtt.client as mqtt # Get a robotic arm object ArmDance = Arm_Device() time.sleep(.1) time_1 = 500 time_2 = 1000 time_sleep = 0.5 broker_address = "192.168.1.32" # DOFBOT dancing def main(): ReturnPosition = [] for x in range(6): Position = ArmDance.Arm_serial_servo_read(x+1) if Position == None: Position = 90 ReturnPosition.append(Position) #ReturnPosition.reverse() #print(ReturnPosition) # Middle servo ArmDance.Arm_serial_servo_write6(90, 90, 90, 90, 90, 90, 500) time.sleep(1)
import time from Arm_Lib import Arm_Device # Get DOFBOT object Arm = Arm_Device() time.sleep(.1) # Open the study mode, the RGB light on the expansion board will keep breathing light, and all the servos of the DFOBOT will close the torque. # At this point, we can manually control the DFOBOT to complete some actions Arm.Arm_Button_Mode(1) # In the study mode, every time you run this cell, the current action is recorded and saved, and the RGB lights on the expansion board will switch colors. # If the red breathing light appears, it means that the learned action group is full (20 groups). # This command can also be replaced by pressing the K1 button on the expansion board. Arm.Arm_Action_Study() # Close study mode and breathing light will be closed Arm.Arm_Button_Mode(0) # Read the number of currently recorded action groups num = Arm.Arm_Read_Action_Num() print(num) # Run action group single Arm.Arm_Action_Mode(1) # Run action group in loop Arm.Arm_Action_Mode(2) # Stop action group Arm.Arm_Action_Mode(0)
import time from Arm_Lib import Arm_Device # Get the object of DOFBOT Arm = Arm_Device() time.sleep(.1) # Buzzer whistle 100 milliseconds b_time = 1 Arm.Arm_Buzzer_On(b_time) time.sleep(1) # Buzzer whistle 300 milliseconds b_time = 3 Arm.Arm_Buzzer_On(b_time) time.sleep(1) # Buzzer whistle all the time Arm.Arm_Buzzer_On() time.sleep(1) # Close buzzer Arm.Arm_Buzzer_Off() time.sleep(1) del Arm # Release the DOFBOT object