Arm_Buzzer_On(delay=255)
Function: turn on the buzzer.
Parameter explanation:
delay: The input range of delay is 1~50. The larger the value, the longer the buzzer will sound. It will automatically turn off after timeout. The delay time is specified as: 1=100 milliseconds, 2=200 milliseconds, and so on. The longest delay is The time is 50=5 seconds. If delay does not pass in a value, or delay=255, it means that the buzzer beeps for a long time and needs to be turned off manually.
Return value: None.
Arm_Buzzer_Off()
Function explanation: Turn off the buzzer.
Parameter explanation: No parameters .
Return value: None
Code path: /home/jetson/Dofbot/3.ctrl_Arm/2.beep.ipynb
#!/usr/bin/env python3
#coding=utf-8
import time
from Arm_Lib import Arm_Device
xxxxxxxxxx
# Get the object of the robotic arm
Arm = Arm_Device()
time.sleep(.1)
xxxxxxxxxx
# The buzzer sounds for 100 ms and then turns off.
b_time = 1
Arm.Arm_Buzzer_On(b_time)
time.sleep(1)
xxxxxxxxxx
# The buzzer sounds for 300 ms and then turns off.
b_time = 3
Arm.Arm_Buzzer_On(b_time)
time.sleep(1)
xxxxxxxxxx
# The buzzer keeps sound
Arm.Arm_Buzzer_On()
time.sleep(1)
xxxxxxxxxx
# Turn off buzzer
Arm.Arm_Buzzer_Off()
time.sleep(1)
xxxxxxxxxx
del Arm # Release the Arm object
Open the 2.beep.ipynb file from jupyter lab and click the Run entire notebook button on the jupyter lab toolbar.
You can hear the buzzer on the expansion board beeping three times in a row, and the sound from the back is longer than the sound from the front.
It will automatically exit after running code.