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 #131 background imageLoading...
Page #131 background image
Need support? support.freenove.com
127
Chapter 7 Smart video car
www.freenove.com
Buzzer. For more details, please refer to Buzzer.
1
2
3
4
5
6
from Buzzer import * #import Led
from Command import COMMAND as cmd #import Led
buzzer=Buzzer() #create an object
buzzer.run(1) #Start
time.sleep(3) #wait 3s
buzzer.run(0) #Stop
Servo. For more details, please refer to Servo.
1
2
3
4
5
6
7
8
9
10
from servo import * #import Led
pwm = Servo() #create an object
#Servo rotates from 30 degrees to 150 degrees
for i in range(30, 150, 1) :
pwm.setServoPwm('0', i)
time.sleep(0.01)
#Servo rotates from 150 degrees to 0 degrees
for i in range(150, 30, -1) :
pwm.setServoPwm('0', i)
time.sleep(0.01)
Ultrasonic module. For more details, please refer to Ultrasonic module.
1
2
3
4
from Ultrasonic import * #import Led
ultrasonic=Ultrasonic() #create an object
data=ultrasonic.get_distance() #Get the value
print ("Obstacle distance is "+str(data)+"CM")
These codes can be integrated into one code to achieve your requirement.

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