Page 1
Using VisionFive GPIO to Make A Buzzer Beep with Python Application Note Version: 1.0 Date: 2022/06/30 Doc ID: VisionFive-ANEN-007-1.0...
Page 2
StarFive does not assume any liability rising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation indirect, incidental, special, exemplary, or consequential damages.
Page 3
Preface About this guide and technical support information. About this document This application note provides steps to use VisionFive's GPIO pins to make a buzzer beep through an example program with Python. Revision History Table 0-1 Revision History Version Released Revision V1.0 2022-06-30...
Prepare the following hardware items before running the demo code: Table 2-1 Hardware Preparation Type Item Notes General StarFive single board computer The following boards are applicable: • StarLight • VisionFive General • 16 GB (or more) micro-SD card These items are used for flashing Fedora OS into a micro-SD card.
If the value is out of the range (200 to 20000 Hz) , a warning message will display, and you need to re- enter the pitch value. ◦ Enter Cycle (seconds): The time in seconds when the buzzer keeps beeping. For example, Example: [riscv@fedora-starfive sample-code]$ sudo python3 buzzer.py Enter Pitch (200 to 20000): 400 Enter Cycle (seconds): 100 Result: The buzzer keeps beeping for 100 seconds at 400 Hz.
Need help?
Do you have a question about the VisionFive GPIO and is the answer not in the manual?
Questions and answers