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 #67 background imageLoading...
Page #67 background image
Need support? support.freenove.com
63
Chapter 3 Module test (necessary)
www.freenove.com
Motor
Run program
Open the terminal of Raspberry Pi. Enter the following commands to test the motor.
1. Use the cd command to enter the directory where test.py is located.
cd ~/Freenove_4WD_Smart_Car_Kit_for_Raspberry_Pi/Code/Server
2. Execute test.py command:
sudo python test.py Motor
Result:
The car moves forward for 1 seconds, then moves back for 1 seconds, then turns left for 1 seconds, turns right
for 1 seconds, then stops. You can press "Ctrl + C" to end the program ahead of time. If the car doesnt work
normally, please check if both switches are pressed.
If the direction is reversed, it moves back then move forward, please follow steps below.
1. Find Motor.py in the following path in your Raspberry Pi:
Freenove_4WD_Smart_Car_Kit_for_Raspberry_Pi/Code/Server/Motor.py
Open Motor.py and add a –“ before duty1,2,3,4 like below.
1
2
3
4
5
6
def setMotorModel(self,duty1,duty2,duty3,duty4):
duty1,duty2,duty3,duty4=self.duty_range(duty1,duty2,duty3,duty4)
self.left_Upper_Wheel(-duty1)
self.left_Lower_Wheel(-duty2)
self.right_Upper_Wheel(-duty3)
self.right_Lower_Wheel(-duty4)
Then save the modification and try again.

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