EasyManuals Logo

Freenove 4WD Smart Car Board for Raspberry Pi User Manual

Default Icon
132 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #80 background imageLoading...
Page #80 background image
Need support? support.freenove.com
76
Chapter 3 Module test (necessary)
Buzzer
Run the program
Enter the following command in the terminal to test buzzer.
If the terminal displays the directory as below (where test.py is located). You can directly execute the test.py
command.
1 If not, execute the cd command:
cd ~/Freenove_4WD_Smart_Car_Kit_for_Raspberry_Pi/Code/Server
2 Execute test.py command:
sudo python test.py Buzzer
Result:
The buzzer will be turned on and last for 3s. Then the program will automatically end or you can press "Ctrl
+ C" to end the program.
The code is as below:
1
2
3
4
5
6
7
8
9
10
11
12
from Buzzer import *
buzzer=Buzzer()
def test_Buzzer():
try:
buzzer.run(cmd.CMD_START)
time.sleep(1)
print "1S"
time.sleep(1)
print "2S"
time.sleep(1)
print "3S"
buzzer.run(cmd.CMD_STOP)

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Freenove 4WD Smart Car Board for Raspberry Pi and is the answer not in the manual?

Freenove 4WD Smart Car Board for Raspberry Pi Specifications

General IconGeneral
BrandFreenove
Model4WD Smart Car Board for Raspberry Pi
CategoryMicrocontrollers
LanguageEnglish