StarFive VisionFive GPIO Manuale utente

Using VisionFive GPIO to Make A
Buzzer Beep

Legal Statements
PROPRIETARY NOTICE
Contact Us
StarFive

Preface
About this document
Revision History
Table 0-1 Revision History
Version Released Revision
Notes and noces
•Tip:
•Note:
•Important:
•CAUTION:
•Warning:
StarFive

Contents
1. Introducon.........................................................................................................................................................................7
2. Preparaon.......................................................................................................................................................................... 8
3. Running Demo Code.......................................................................................................................................................... 10
4. Demo Source Code............................................................................................................................................................ 11
StarFive

List of Tables
StarFive

List of Figures
StarFive

1. Introducon
1.1. 40-Pin Header Denion
Figure 1-1 40-Pin Denion
StarFive

2. Preparaon
2.1. Preparing Hardware
Table 2-1 Hardware Preparaon
Type M/O*Item Notes
•
•
•
•
•
•
•
•
•
Note:
2.1.1. Hardware Setup
Table 2-2 Connect LED to the 40-Pin Header
40-Pin GPIO Header
Passive Buzzer
Pin Number Pin Name
StarFive

Figure 2-1 Connect Buzzer to the 40-Pin Header
1
3
5
7
9
11
17
19
13
15
2
4
6
8
10
12
18
20
14
16
5V Power
5V Power
GND
GPIO14 (UART TX)
GPIO13 (UART RX)
GPIO45
GPIO19
GND
GND
GPIO21
3.3V Power
GPIO48 (I2C SDA)
GPIO47 (I2C SCL)
GPIO46
GND
GPIO44
3.3V Power
GPIO18 (SPI MOSI)
GPIO22
GPIO20
VCC
I/O
GND
Passive Buzzer
2.2. Preparing Soware
Flashing Fedora OS to a Micro-SD Card VisionFive
Single Board Computer Quick Start Guide
Using
SSH over Ethernet Using a USB to Serial Converter VisionFive Single Board Computer Quick Start Guide
pipVisionFive.gpio
sudo pip install VisionFive.gpio
sudo pip3 install VisionFive.gpio
Tip:
sudo yum install python-devel python3-devel
sudo python setup.py install
sudo python3 setup.py install
StarFive

3. Running Demo Code
buzzer.py
VisionFive.gpio
pip show VisionFive.gpio
Result:
Location: /usr/local/lib64/python3.9/site-packages
/usr/local/lib64/python3.9/site-
packages
cd /usr/local/lib64/python3.9/site-packages
sample-code
cd ./VisionFive/sample-code/
sample-code
sudo python buzzer.py
sudo python3 buzzer.py
◦Enter Pitch (200 to 20000)400
Note:
◦Enter Cycle (seconds)100
Example:
[riscv@fedora-starfive sample-code]$ sudo python3 buzzer.py
Enter Pitch (200 to 20000): 400
Enter Cycle (seconds): 100
Result:
StarFive
Indice
Altri manuali StarFive Hardware per computer
Manuali Hardware per computer popolari di altre marche

EMC2
EMC2 VNX Series Manuale del proprietario

Panasonic
Panasonic DV0PM20105 Manuale utente

Mitsubishi Electric
Mitsubishi Electric Q81BD-J61BT11 Manuale utente

Gigabyte
Gigabyte B660M DS3H AX DDR4 Manuale utente

Raidon
Raidon iT2300 Manuale utente

National Instruments
National Instruments PXI-8186 Manuale utente












