Connection:
L298N to Motors:
K1/K2 to right motors
K3/K4 to left motors
GP16(Physical#21) to IN1 right motor direction pin GP17(Physical#22) to IN2 right motor direction pin GP18(Physical#24) to IN3 left motor direction pin GP19(Physical#25) to IN4 left motor direction pin GP10(Physical#14) to ENA right motor PWM GP9 (Physical#12) to ENB left motor PWM GP15(Physical#20) to Servo pin GP7 (Physical#10) to Trig_PIN GP8 (Physical#11) to Trig_PIN
GP# as per the light green pin icons in following picture:
Step 1) Install Arduino IDE
Visit https://www.arduino.cc/en/software and install the latest Arduino IDE software for your computer
Step 2) Install Arduino Mbed OS RP2040 board to support Pico:
Open Arduino IDE ->Tools ->Board Manager
In search bar, search pico , you will find a board name “Arduino Mbed OS RP2040 board “, Click Install button to install the latest version for this board into IDE.
Step 3) Install RP2040_PWM library
Download the RP2040_PWM.zip file from https://osoyoo.com/download/RP2040_PWM.zip
Then Open Arduino IDE-> click Sketch->Include Library->Add .Zip Library->upload the RP2040_PWM.zip file to IDE
Step 4)Download and Run the Arduino Code:
Please download the code file from https://osoyoo.com/driver/pico_car/lesson3/picocar-lesson3.zip
Unzip the file and run the picocar-lesson3.ino sketch file through Arduino IDE, after you upload the code, please put the car to ground, your car will automatically run and avoid obstacles.
DownLoad Url osoyoo.com