Welcome to ROS Robot Expansion Board repository
4. Buzzer whistle
4. Buzzer whistle
4. Buzzer whistle4.1. Experimental goal4.2. Experiment preparation4.3 Experimental operation and phenomenon4.4. Program source code
4.1. Experimental goal
Control the buzzer switch on the expansion board, the whistle time is 100ms, 300ms, 1s, etc.
4.2. Experiment preparation
The red box in the picture is the buzzer on the expansion board.

The buzzer on the expansion board is an active buzzer, so it is relatively simple to control, please check the following functions.
Rosmaster_Lib library functions needed to control the buzzer:
set_beep(on_time)Parameter explanation: on_time=0: turn off, on_time=1: keep ringing, on_time>=10: turn off automatically after ringing for xx milliseconds (on_time is a multiple of 10).
Return value: None.
4.3 Experimental operation and phenomenon
Check out the course accompanying video.
4.4. Program source code
Check 【Sample code】---> check file: Before running above code on RDK X3, ReadMe. Complete the operation process.
Reference code path: Rosmaster/Samples/4.beep.ipynb