Welcome to DOFBOT-JetsonNANO repository
2.Control buzzer
Control Buzzer
I. API Introduction
The corresponding API for the buzzer is:
Arm_Buzzer_On(delay=255)
Function: Turn on the buzzer.
Parameter explanation:
delay: The input range for delay is 1~50. The larger the value, the longer the buzzer will sound. It will automatically turn off after timeout. Delay time specification: 1=100 milliseconds, 2=200 milliseconds, and so on, with the maximum delay time being 50=5 seconds. If no value is passed for delay or delay=255, it means the buzzer will sound continuously and needs to be manually turned off.Return value: None.
Arm_Buzzer_Off()
Function: Turn off the buzzer.
Parameter explanation:
xNo input parameters.Return value: None
II. Start Docker
After entering the main board desktop, open a terminal and run the following command to start the corresponding Dofbot container:
xxxxxxxxxx./Docker_Ros.sh
Then enter the following command in the Docker terminal to start jupyter-lab,
xxxxxxxxxxcdjupyter-lab --allow-root
Then enter the main board's IP address followed by :9999 in the browser,
xxxxxxxxxxIP:9999 // Example: 192.168.1.11:9999
III. Code Content
Code path: /root/Dofbot/3.ctrl_Arm/2.beep.ipynb
xxxxxxxxxx#!/usr/bin/env python3#coding=utf-8import timefrom Arm_Lib import Arm_Devicexxxxxxxxxx# Get the robotic arm 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 sounds continuouslyArm.Arm_Buzzer_On()time.sleep(1)xxxxxxxxxx# Turn off the buzzerArm.Arm_Buzzer_Off()time.sleep(1)xxxxxxxxxxdel Arm # Release the Arm objectOpen the 2.beep.ipynb file from jupyter lab, and click the "run entire notebook" button on the jupyter lab toolbar, you will hear the buzzer on the expansion board sound three times consecutively, with each subsequent sound being longer than the previous one.

It will automatically exit after running completes.