Welcome to RDK X3 Robot repository
6. The buzzer blows
6. The buzzer whistles
6. The buzzer whistles6.1. Experiment Objective6.2. Experiment Preparation6.3. Program source code6.4. Experimental Manipulations and Phenomena
6.1. Experiment Objective
Control the buzzer switch on the expansion board, whistle time 100 ms, 300 ms, 1 second, etc.
6.2. Experiment Preparation
The red box in the picture shows the buzzer on the expansion board.

The buzzer on the expansion board is an active buzzer, so it is easy to control, please check the following functions.
SunriseRobotLib library functions needed to control the buzzer:
xxxxxxxxxxset_beep(on_time)Parameter Description: on_time=0: Off, on_time=1: always ringing, on_time>=10: automatically off after ringing xx milliseconds (on_time is a multiple of 10).
Returned value: None.
6.3. Program source code
Turn on the robot and open the browser of the robot system or remote computer to enter the Jupyter lab editor.
Reference code path: / root/sunriseRobot _basic/Samples / 1/3 _beep. Ipynb
6.4. Experimental Manipulations and Phenomena
Open jupyterlab, find the corresponding program source code, please close other running source files first.
Click the Run button in sequence, run each cell, you can hear the buzzer whistle effect.