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 #130 background imageLoading...
Page #130 background image
Need support? support.freenove.com
126
Chapter 7 Smart video car
Open the terminal and use the following command to enter the directory where test_Code.py is located:
cd ~/Desktop/Test
Run test_Code.py:
sudo python test_Code.py
Code example
Following are code example for the parts. For more detail, please refer to Module test section.
For more details, please refer to Motor.
1
2
3
4
5
from Motor import * #import Motor
PWM=Motor() #create an object
PWM.setMotorModel(2000,2000,2000,2000) #Forward
time.sleep(3) #waiting 3 second
PWM.setMotorModel(0,0,0,0) #Stop
ADC. For more details, please refer to ADC.
1
2
3
4
from ADC import * #import ADC
adc=Adc() #create an object
Left_IDR=adc.recvADC(0) #get value
print ("The photoresistor voltage on the left is "+str(Left_IDR)+"V")
LED. For more details, please refer to LED.
1
2
3
4
5
6
from Led import * #import Led
led=Led() #create an object
led.ledIndex(0x04,255,255,0) #yellow
led.ledIndex(0x80,0,255,0) #green
time.sleep(5) #wait 5s
led.colorWipe(led.strip, Color(0,0,0)) #turn off

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