Welcome to DOFBOT SE repository
2.Control buzzer
Control Buzzer
1. API Introduction
The API for buzzer:
Arm_Buzzer_On(delay=255)
Function: Turn on the buzzer.
Parameters:
delay: The input range for delay is 1~50. A larger value means the buzzer sounds longer. It automatically turns off after timeout. Delay time specification: 1=100 milliseconds, 2=200 milliseconds, and so on. The maximum delay time is 50=5 seconds. If no value is passed or delay=255, the buzzer will beep continuously and needs to be manually turned off.
Return value: None.
Arm_Buzzer_Off()
Function: Turn off the buzzer.
Parameters:
No parameters.
Return value: None.
2. Code Content
Code path: /home/yahboom/Dofbot/3.ctrl_Arm/2.beep.ipynb
#!/usr/bin/env python3#coding=utf-8import timefrom Arm_Lib import Arm_Devicexxxxxxxxxx# Get DOFBOT objectArm = Arm_Device()time.sleep(.1)xxxxxxxxxx# Buzzer automatically sounds for 100 milliseconds then turns offb_time = 1Arm.Arm_Buzzer_On(b_time)time.sleep(1)xxxxxxxxxx# Buzzer automatically sounds for 300 milliseconds then turns offb_time = 3Arm.Arm_Buzzer_On(b_time)time.sleep(1)xxxxxxxxxx# Buzzer keeps soundingArm.Arm_Buzzer_On()time.sleep(1)xxxxxxxxxx# Turn off the buzzerArm.Arm_Buzzer_Off()time.sleep(1)xxxxxxxxxxdel Arm # Release Arm objectOpen the 2.beep.ipynb file from jupyter lab, and click the "Run All" button on the jupyter lab toolbar to hear the buzzer on the expansion board beep three times in succession, with each subsequent beep lasting longer than the previous one.

It will automatically exit after running.