SunFounder PiCar-X Kit Manual

Hide thumbs Also See for PiCar-X Kit:
Table of Contents

Advertisement

SunFounder PiCar-X Kit
www.sunfounder.com
Jun 14, 2024

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PiCar-X Kit and is the answer not in the manual?

Questions and answers

Summary of Contents for SunFounder PiCar-X Kit

  • Page 1 SunFounder PiCar-X Kit www.sunfounder.com Jun 14, 2024...
  • Page 3: Table Of Contents

    CONTENTS 1 Introduction The History of Self-driving Cars ........About PiCar-X .
  • Page 4 Video 2: Controlling the PiCar-X using keyboard ......Video 3: Text to Speech .
  • Page 5 SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 6 – To get Picar-X working properly, you must install some libraries first. – The Raspberry Pi configuration and samples code for the PiCar-X are provided in this chapter. – An APP - SunFounder Controller is also provided to allow you to remotely control the PiCar-X on your mobile device.
  • Page 7: Introduction

    CHAPTER INTRODUCTION 1.1 The History of Self-driving Cars Experiments have been conducted on self-driving cars since at least the 1920’s. Promising trials took place in the 1950’s, and work has proceeded forward ever since. The first self-sufficient and truly autonomous cars appeared in the 1980’s, with Carnegie Mellon University’s Navlab and ALV projects in 1984, and Mercedes-Benz and Bundeswehr University Munich’s Eureka Prometheus Project in 1987.
  • Page 8 SunFounder PiCar-X Kit Recent rapid advances in software (Artificial Intelligence, Machine Learning), hardware (GPUs, FPGAs, accelerome- ters, etc.), and cloud computing are driving this technological revolution forward. • In October 2010, a driverless truck designed by the Italian technology company Vislab took three months to travel from Italy to China, with a total distance of 8, 077 miles.
  • Page 9: About Picar-X

    Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 10 SunFounder PiCar-X Kit Chapter 1. Introduction...
  • Page 11: Assembly Instructions

    Raspberry Pi OS, then install the required modules, and then run a script (set the angle of all PWM pins to 0). After that, plug in the servo wire to zero the servo. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 12 SunFounder PiCar-X Kit Chapter 2. Assembly Instructions...
  • Page 13: Adjust Servo For Assembly

    After you have installed the ezblock system, the P11 pin can be used to adjust the servo. Please refer to Quick Guide for details. on EzBlock Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join?
  • Page 14 SunFounder PiCar-X Kit • Expert Support: Solve post-sale issues and technical challenges with help from our community and team. • Learn & Share: Exchange tips and tutorials to enhance your skills. • Exclusive Previews: Get early access to new product announcements and sneak peeks.
  • Page 15: Play With Python

    Raspberry Pi OS are needed. To start configuring the Raspberry Pi, please reference Quick Guide on Python: Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 16: What Do We Need

    SunFounder PiCar-X Kit 4.1.1 1. What Do We Need? Required Components Raspberry Pi The Raspberry Pi is a low cost, credit-card sized computer that plugs into a computer monitor or TV, and uses a standard keyboard and mouse. It is a capable little device that enables people of all ages to explore computing, and to learn how to program in languages like Scratch and Python.
  • Page 17: Installing The Os

    The Raspberry Pi is equipped with an audio port about 3.5 mm that can be used when your screen has no built-in speakers or when there is no screen operation. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 18 SunFounder PiCar-X Kit 3. Launch the Raspberry Pi Imager application by clicking its icon or typing rpi-imager in your terminal. 2. Install OS to Micro SD Card 1. Insert your SD card into your computer or laptop using a Reader.
  • Page 19 SunFounder PiCar-X Kit 3. Select Operating System and opt for the recommended operating system version. 4. Click Choose Storage and select the appropriate storage device for the installation. Note: Ensure you select the correct storage device. To avoid confusion, disconnect any additional...
  • Page 20 SunFounder PiCar-X Kit storage devices if multiple ones are connected. 5. Click NEXT and then EDIT SETTINGS to tailor your OS settings. Note: If you have a monitor for your Raspberry Pi, you can skip the next steps and click ‘Yes’ to begin the installation.
  • Page 21 SunFounder PiCar-X Kit 6. Define a hostname for your Raspberry Pi. The hostname is your Raspberry Pi’s network identifier. You can access your Pi using Note: <hostname>.local or <hostname>.lan. 7. Create a Username and Password for the Raspberry Pi’s administrator account.
  • Page 22 SunFounder PiCar-X Kit 8. Configure the wireless LAN by providing your network’s SSID and Password. Note: Set the Wireless LAN country to the two-letter ISO/IEC alpha2 code corresponding to your location. 9. To remotely connect to your Raspberry Pi, enable SSH in the Services tab.
  • Page 23 SunFounder PiCar-X Kit 10. The Options menu lets you configure Imager’s behavior during a write, including playing sound when finished, ejecting media when finished, and enabling telemetry. 4.1. Quick Guide on Python...
  • Page 24 SunFounder PiCar-X Kit 11. When you’ve finished entering OS customisation settings, click Save to save your customisation. Then, click Yes to apply them when writing the image. 12. If the SD card contains existing data, ensure you back it up to prevent data loss. Proceed by clicking Yes if no backup is needed.
  • Page 25 SunFounder PiCar-X Kit 13. When you see the “Write Successful” popup, your image has been completely written and verified. You’re now ready to boot a Raspberry Pi from the Micro SD Card! 14. Now you can insert the SD card set up with Raspberry Pi OS into the microSD card slot located on the underside of the Raspberry Pi.
  • Page 26 SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 27: Power Supply For Raspberry Pi (Important)

    SunFounder PiCar-X Kit 4.1.3 3. Power Supply for Raspberry Pi (Important) Charge Insert the battery cable. Next, insert the USB-C cable to charge the battery. You will need to provide your own charger; we recommend a 5V 3A charger, or your commonly used smartphone charger will suffice.
  • Page 28 SunFounder PiCar-X Kit Power ON Turn on the power switch. The Power indicator light and the battery level indicator light will illuminate. Wait for a few seconds, and you will hear a slight beep, indicating that the Raspberry Pi has successfully booted.
  • Page 29 • GND: Negative battery terminal. This is a custom battery pack made by SunFounder consisting of two 18650 batteries with a capacity of 2000mAh. The connector is XH2.54 3P, which can be charged directly after being inserted into the shield.
  • Page 30: Set Up Your Raspberry Pi

    SunFounder PiCar-X Kit • Connector:XH2.54 3P Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 31 SunFounder PiCar-X Kit If You Have No Screen If you don’t have a monitor, you can remotely log into your Raspberry Pi. Required Components • Raspberry Pi • Power Adapter • Micro SD card You can apply the SSH command to open the Raspberry Pi’s Bash shell. Bash is the standard default shell for Linux.
  • Page 32 Last login: Thu Sep 22 12:18:22 2022 pi@raspberrypi:~ $ Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? •...
  • Page 33 SunFounder PiCar-X Kit For Windows Users For Windows 10 or higher users, remote login to a Raspberry Pi can be achieved through the following steps: 1. Search for powershell in your Windows search box. Right-click on Windows PowerShell and select Run as administrator.
  • Page 34 6. Once connected, your Raspberry Pi is ready for remote operations. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 35 6. Once you’ve successfully logged in, your Raspberry Pi is now connected, and you’re ready to proceed to the next step. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 36 SunFounder PiCar-X Kit Remote Desktop Access for Raspberry Pi For those preferring a graphical user interface (GUI) over command-line access, the Raspberry Pi supports remote desktop functionality. This guide will walk you through setting up and using VNC (Virtual Network Computing) for remote access.
  • Page 37 SunFounder PiCar-X Kit Logging in via VNC Viewer 1. Download and install VNC Viewer on your personal computer. 2. Once installed, launch VNC Viewer. Enter the hostname or IP address of your Raspberry Pi and press Enter. 3. When prompted, enter your Raspberry Pi’s username and password, then click OK.
  • Page 38 4. After a few seconds, the Raspberry Pi OS desktop will be displayed. Now you can open the Terminal to start entering commands. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 39: Install All The Modules(Important)

    Install robot-hat. git clone -b v2.0 https://github.com/sunfounder/robot-hat.git cd robot-hat sudo python3 setup.py install Then download and install the vilib module. git clone -b picamera2 https://github.com/sunfounder/vilib.git cd vilib sudo python3 install.py Download and install the picar-x module. git clone -b v2.0 https://github.com/sunfounder/picar-x.git cd picar-x sudo python3 setup.py install...
  • Page 40 SunFounder PiCar-X Kit Type y and press enter to continue running the script. Type y and press enter to run /dev/zero in the background. Chapter 4. Play with Python...
  • Page 41 Note: If there is no sound after restarting, you may need to run the i2samp.sh script several times. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 42: Enable I2C Interface(Important)

    SunFounder PiCar-X Kit 4.1.6 6. Enable I2C Interface(Important) We will be using the Raspberry Pi’s I2C interface. This interface should have been enabled when installing the robot-hat module earlier. To ensure everything is in order, let’s check if it is indeed enabled.
  • Page 43 5. After you select <Finish>, a pop-up will remind you that you need to reboot for the settings to take effect, select <Yes>. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 44: Servo Adjust(Important)

    SunFounder PiCar-X Kit • Special Discounts: Enjoy exclusive discounts on our newest products. • Festive Promotions and Giveaways: Take part in giveaways and holiday promotions. Ready to explore and create with us? Click [] and join today! 4.1.7 7. Servo Adjust(Important) The angle range of the servo is -90~90, but the angle set at the factory is random, maybe 0°, maybe 45°;...
  • Page 45 In our assembly video from 6:25 to 8:48, there is also a detailed tutorial for this chapter. You can follow the video instructions directly. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 46: Calibrating The Picar-X

    SunFounder PiCar-X Kit Ready to explore and create with us? Click [] and join today! 4.2 0. Calibrating the PiCar-X 4.2.1 Calibrate Motors & Servo Some servo angles may be slightly tilted due to possible deviations during PiCar-X installation or limitations of the servos themselves, so you can calibrate them.
  • Page 47 SunFounder PiCar-X Kit 5. Press the number key 2 to select the Pan servo, then press the W/S key to make the pan/tilt platform look straight ahead and not tilt left or right. 6. Press the number key 3 to select the tilt servo, then press the W/S key to make the pan/tilt platform look straight ahead and not tilt up and down.
  • Page 48 SunFounder PiCar-X Kit 7. Since the wiring of the motors may be reversed during installation, you can press E to test whether the car can move forward normally. If not, use the number keys 4 and 5 to select the left and right motors, then press the Q key to calibrate the rotation direction.
  • Page 49: Calibrate Grayscale Module

    SunFounder PiCar-X Kit 4.2.2 Calibrate Grayscale Module Due to varying environmental conditions and lighting situations, the preset parameters for the greyscale module might not be optimal. You can fine-tune these settings through this program to achieve better results. 1. Lay down a strip of black electrical tape, about 15cm long, on a light-colored floor. Center your PiCar-X so that it straddles the tape.
  • Page 50 SunFounder PiCar-X Kit 4. Press the “Q” key to initiate the greyscale calibration. You’ll then observe the PiCar-X make minor movements to both the left and the right. During this process, each of the three sensors should sweep across the electrical tape at least once.
  • Page 51 Ctrl+C. After the PiCar-X assembly is completed, try running the projects below: Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 52: Let Picar-X Move

    SunFounder PiCar-X Kit 4.3 1. Let PiCar-X Move This is the first project, let’s test the basic movement of Picar-X. Run the Code cd ~/picar-x/example sudo python3 1.move.py After running the code, PiCar-X will move forward, turn in an S-shape, stop and shake its head.
  • Page 53 SunFounder PiCar-X Kit (continued from previous page) angle range(-35,0): px.set_camera_servo2_angle(angle) time.sleep(0.01) finally: px.forward(0) How it works? The basic functionality of PiCar-X is in the picarx module, Can be used to control steering gear and wheels, and will make the PiCar-X move forward, turn in an S-shape, or shake its head.
  • Page 54 SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 55: Keyboard Control

    SunFounder PiCar-X Kit 4.4 2. Keyboard Control In this project, we will learn how to use the keyboard to remotely control the PiCar-X. You can control the PiCar-X to move forward, backward, left, and right. Run the Code cd ~/picar-x/example sudo python3 2.keyboard_control.py...
  • Page 56 SunFounder PiCar-X Kit (continued from previous page) Picarx() show_info() while True: readchar.readkey() key.lower() key in( wsadikjl key: px.set_dir_servo_angle(0) px.forward(80) elif key: px.set_dir_servo_angle(0) px.backward(80) elif key: px.set_dir_servo_angle(-35) px.forward(80) elif key: px.set_dir_servo_angle(35) px.forward(80) elif key: tilt_angle+=5 tilt_angle>35: tilt_angle=35 elif key: tilt_angle-=5 tilt_angle<-35:...
  • Page 57: Text To Speech & Sound Effect

    Quit") break Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 58 SunFounder PiCar-X Kit Install i2samp Before using the Text-to-Speech (TTS) and Sound Effect functions, first activate the speaker so that it will be enabled and can make sounds. Run i2samp.sh in the picar-x folder, and this script will install everything needed to use i2s amplifier.
  • Page 59 SunFounder PiCar-X Kit There will be several prompts asking to confirm the request. Respond to all prompts with a Y. After the changes have been made to the Raspberry Pi system, the computer will need to reboot for these changes to take effect.
  • Page 60 SunFounder PiCar-X Kit (continued from previous page) TTS() manual Input key to call the function! space: Play sound effect (Car horn) c: Play sound effect with threads t: Text to speak q: Play/Stop Music main(): print(manual) False flag_bgm music.music_set_volume(20) tts.lang("en-US")
  • Page 61 France-Le français it-IT Italia-lingua italiana Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 62: Obstacle Avoidance

    SunFounder PiCar-X Kit 4.6 4. Obstacle Avoidance In this project, PiCar-X will detect obstacles in front of it while moving forward, and when the obstacles are too close, it will change the direction of moving forward. Run the Code cd ~/picar-x/example sudo python3 4.avoiding_obstacles.py...
  • Page 63 SunFounder PiCar-X Kit (continued from previous page) __name__ "__main__": main() How it works? • Importing the Picarx Module and Initializing Constants: This section of the code imports the Picarx class from the picarx module, which is essential for con- trolling the Picarx robot. Constants like POWER, SafeDistance, and DangerDistance are defined, which will be used later in the script to control the robot’s movement based on distance measurements.
  • Page 64: Line Tracking

    The robot’s movement is adapted based on these measurements, ensuring safe operation through careful control and a safety mechanism in the finally block. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 65 SunFounder PiCar-X Kit from picarx import Picarx from time import sleep Picarx() # px = Picarx(grayscale_pins=['A0', 'A1', 'A2']) # Please run ./calibration/grayscale_calibration.py to Auto calibrate grayscale values # or manual modify reference value by follow code # px.set_line_reference([1400, 1400, 1400])
  • Page 66 SunFounder PiCar-X Kit (continued from previous page) gm_state forward px.set_dir_servo_angle(0) px.forward(px_power) elif gm_state left px.set_dir_servo_angle(offset) px.forward(px_power) elif gm_state right px.set_dir_servo_angle(-offset) px.forward(px_power) else: outHandle() finally: px.stop() print("stop and exit") sleep(0.1) How it works? This Python script controls a Picarx robot car using grayscale sensors for navigation. Here’s a breakdown of its main components: •...
  • Page 67 SunFounder PiCar-X Kit (continued from previous page) px.set_dir_servo_angle(-30) px.backward(10) elif last_state right px.set_dir_servo_angle(30) px.backward(10) while True: gm_val_list px.get_grayscale_data() gm_state get_status(gm_val_list) print("outHandle gm_val_list: %s, %s"%(gm_val_list, gm_state)) currentSta gm_state currentSta last_state: break sleep(0.001) • get_status Function: It interprets the grayscale sensor data (val_list) to determine the car’s navigation state.
  • Page 68: Cliff Detection

    Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 69 If the result is true, it is detected that there is a cliff in front of the car. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 70: Computer Vision

    SunFounder PiCar-X Kit • Expert Support: Solve post-sale issues and technical challenges with help from our community and team. • Learn & Share: Exchange tips and tutorials to enhance your skills. • Exclusive Previews: Get early access to new product announcements and sneak peeks.
  • Page 71 SunFounder PiCar-X Kit • r: Scan the QR code • f: Switch ON/OFF face detect • s: Display detected object information Please follow the prompts to activate the corresponding functions. • Take Photo Type q in the terminal and press Enter. The picture currently seen by the camera will be saved (if the color detection function is turned on, the mark box will also appear in the saved picture).
  • Page 72 SunFounder PiCar-X Kit • QR Code Detect Enter r to open the QR code recognition. No other operations can be performed before the QR code is recognized. The decoding information of the QR code will be printed in the terminal.
  • Page 73 SunFounder PiCar-X Kit Entering s will print the information of the face detection (and color detection) target in the terminal. Including the center coordinates (X, Y) and size (Weight, height) of the measured object. Code from pydoc import text from...
  • Page 74 SunFounder PiCar-X Kit (continued from previous page) sleep(0.5) Vilib.qrcode_detect_switch(False) take_photo(): _time strftime( %Y-%m-%d-%H-%M-%S ,localtime(time())) name photo_%s %_time username os.getlogin() path f"/home/{username}/Pictures/" Vilib.take_photo(name, path) print( photo save as %s%s.jpg %(path,name)) object_show(): global flag_color, flag_face flag_color True: Vilib.detect_obj_parameter[ color_n print( Color Detect: None...
  • Page 75 SunFounder PiCar-X Kit (continued from previous page) take_photo() # color detect elif 0123456 # '' in ('0123') -> True index int(key) index flag_color False Vilib.color_detect( close else: flag_color True Vilib.color_detect(color_list[index]) # color_detect(color:str -> color_ name/close) print( Color detect : %color_list[index])
  • Page 76 SunFounder PiCar-X Kit • Vilib.qrcode_detect_switch(False) : Switch ON/OFF QR code detection, Returns the decoded data of the QR code. • Vilib.gesture_detect_switch(False) : Switch ON/OFF gesture detection • Vilib.traffic_sign_detect_switch(False) : Switch ON/OFF traffic sign detection The information detected by the target will be stored in the detect_obj_parameter = Manager().dict() dictio- nary.
  • Page 77: Stare At You

    SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 78 SunFounder PiCar-X Kit (continued from previous page) # change the pan-tilt angle for track the object x_angle +=(coordinate_x*10/640)-5 x_angle clamp_number(x_angle,-35,35) px.set_cam_pan_angle(x_angle) y_angle -=(coordinate_y*10/480)-5 y_angle clamp_number(y_angle,-35,35) px.set_cam_tilt_angle(y_angle) sleep(0.05) else pass sleep(0.05) __name__ "__main__": try: main() finally: px.stop() print("stop and exit") sleep(0.1) How it works? These lines of code in while True make the camera follow the face.
  • Page 79: Record Video

    SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 80 SunFounder PiCar-X Kit (continued from previous page) \r\033[2K print( end= ,flush=True) print(msg, end=end, flush=True) main(): rec_flag stop # start,pause,stop vname None username os.getlogin() Vilib.rec_video_set["path"] f"/home/{username}/Videos/" # set path Vilib.camera_start(vflip=False,hflip=False) Vilib.display(local=True,web=True) sleep(0.8) # wait for startup print(manual) while True: # read keyboard readchar.readkey()
  • Page 81: Bull Fight

    • Vilib.rec_video_stop(): Stop recording. Vilib.rec_video_set["path"] = f"/home/{username}/Videos/" sets the storage location of video files. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 82 SunFounder PiCar-X Kit Then you can enter http://<your IP>:9000/mjpg in the browser to view the video screen. such as: https:// 192.168.18.113:9000/mjpg Code Note: You can Modify/Reset/Copy/Run/Stop the code below. But before that, you need to go to source code path like picar-x\examples.
  • Page 83 • Set the direction servo angle using px.set_dir_servo_angle() to steer the car’s wheels accordingly. • Move the car forward at the specified speed using px.forward(speed). Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 84: Video Car

    SunFounder PiCar-X Kit • Learn & Share: Exchange tips and tutorials to enhance your skills. • Exclusive Previews: Get early access to new product announcements and sneak peeks. • Special Discounts: Enjoy exclusive discounts on our newest products. • Festive Promotions and Giveaways: Take part in giveaways and holiday promotions.
  • Page 85 SunFounder PiCar-X Kit code #!/usr/bin/env python3 from robot_hat.utils import reset_mcu from picarx import Picarx from vilib import Vilib from time import sleep, time, strftime, localtime import readchar import user os.getlogin() user_home os.path.expanduser(f ~{user} reset_mcu() sleep(0.2) manual Press key to call the function(non-case sensitive):...
  • Page 86 SunFounder PiCar-X Kit (continued from previous page) px.backward(speed) elif operate turn left px.set_dir_servo_angle(-30) px.forward(speed) elif operate turn right px.set_dir_servo_angle(30) px.forward(speed) main(): speed status stop Vilib.camera_start(vflip=False,hflip=False) Vilib.display(local=True,web=True) sleep(2) # wait for startup print(manual) while True: print("\rstatus: , speed: "%(status, speed), end=...
  • Page 87: Treasure Hunt

    Vilib.camera_close() Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 88 SunFounder PiCar-X Kit cd ~/picar-x/example sudo python3 12.treasure_hunt.py View the Image After the code runs, the terminal will display the following prompt: No desktop ! * Serving Flask app "vilib.vilib" (lazy loading) * Environment: production WARNING: Do not use the development server in a production environment.
  • Page 89 SunFounder PiCar-X Kit (continued from previous page) color random.choice(color_list) Vilib.color_detect(color) tts.say("Look for " color) None lock threading.Lock() key_scan_thread(): global while True: key_temp readchar.readkey() print( ,end= with lock: key_temp.lower() readchar.key.SPACE: space elif readchar.key.CTRL_C: quit break sleep(0.01) car_move(key): key: px.set_dir_servo_angle(0) px.forward(80) elif key: px.set_dir_servo_angle(0)
  • Page 90 SunFounder PiCar-X Kit (continued from previous page) Vilib.detect_obj_parameter[ color_n ]!=0 Vilib.detect_obj_parameter[ color_w ]>100: tts.say("will done") sleep(0.05) renew_color_detect() with lock: None and wsad car_move(key) sleep(0.5) px.stop() None elif space tts.say("Look for " color) None elif quit _key_t.join() print("\n\rQuit") break sleep(0.05) __name__ "__main__":...
  • Page 91: Controlled By The App

    Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 92 APP Store(iOS) or Google Play(Android). 4. Open and create a new controller. Create a new controller by clicking on the + sign in the SunFounder Controller APP. There are preset controllers for some products in the Preset section, which you can use as needed.
  • Page 93 SunFounder PiCar-X Kit When you click the Connect button, it will automatically search for robots nearby. Its name is defined in picarx_control.py and it must be running at all times. Once you click on the product name, the message “Connected Successfully” will appear and the product name will appear in the upper right corner.
  • Page 94 SunFounder PiCar-X Kit Note: • You need to make sure that your mobile device is connected to the same LAN as PiCar-X. • If it doesn’t search automatically, you can also manually enter the IP to connect. 6. Run this controller.
  • Page 95 Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 96 SunFounder PiCar-X Kit • Special Discounts: Enjoy exclusive discounts on our newest products. • Festive Promotions and Giveaways: Take part in giveaways and holiday promotions. Ready to explore and create with us? Click [] and join today! Chapter 4. Play with Python...
  • Page 97: Python Video Course

    The course begins with three introductory videos that lay the foundation for working with the PiCar-X. These videos cover: Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 98: Video A2: Assembly Of The Picar-X

    Related On-line Tutorials • Quick Guide on Python Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 99: Video A3: Calibrate The Picar-X

    PiCar-X, starting from basic movements to more complex tasks, including: Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 100: Video 1: Motor Move And Steering Control

    Related On-line Tutorials • 1. Let PiCar-X Move Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 101: Video 3: Text To Speech

    Related On-line Tutorials • 2. Keyboard Control Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 102: Video 4: Obstacle Avoidance With Ultrasonic

    Related On-line Tutorials • 4. Obstacle Avoidance Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 103: Video 5: Greyscale Line Tracking

    Related On-line Tutorials • 5. Line Tracking Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 104: Video 7: Picar-X Computer Vision

    Related On-line Tutorials • 6. Cliff Detection Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 105: Video 8: Picar-X Stares At You

    Related On-line Tutorials • 8. Stare at You Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 106: Video 9: Recording Video

    Related On-line Tutorials • 9. Record Video Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 107: Video 11: Picar-X As Video Car

    Related On-line Tutorials • 10. Bull Fight Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 108: Video 12: Treasure Hunt Game

    Related On-line Tutorials • 12. Treasure Hunt Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 109: Video 12: Control Picar-X Robot Car Use Mobile App

    The tutorial provides a comprehensive guide on using the mobile app for the Picar-X Raspberry Pi robot from Sun- Founder. 1. Overview: Explains the setup and usage of the SunFounder Picar-X robot car kit, including how to use the mobile app to control the robot.
  • Page 110 SunFounder PiCar-X Kit Chapter 5. Python Video Course...
  • Page 111: Play With Ezblock

    Note: If you are using a Raspberry Pi 5, you will not be able to use our graphical programming software, EzBlock, to program the PiCrawler. For beginners and novices, EzBlock is a software development platform offered by SunFounder for Raspberry Pi. Ezbock offers two programming environments: a graphical environment and a Python environment.
  • Page 112 SunFounder PiCar-X Kit 1. Firstly, Install EzBlock OS (EzBlock’s own tutorials) onto a Micro SD card, once the installation is complete, insert it into the Raspberry Pi. Note: After the installation is complete, please return to this page. 2. To ensure that the servo has been properly set to 0°, first insert the servo arm into the servo shaft and then gently rotate the rocker arm to a different angle.
  • Page 113 SunFounder PiCar-X Kit 4. Next, plug the servo cable into the P11 port as follows. 5. Press and hold the USR key, then press the RST key to execute the servo zeroing script within the system. When you see the servo arm rotate to a position(This is the 0° position, which is a random location and may not be vertical or parallel.), it indicates that the program has run.
  • Page 114 • This zeroing function will be disabled if you download a program to the robot later with the EzBlock APP. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 115: Install And Configure Ezblock Studio

    But if you think the assembly is perfect and no calibration is needed, you can also skip this step. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 116 SunFounder PiCar-X Kit 2. Click the Settings button. 3. On this page, you can change the product name, product type, view the app version or calibrate the robot. Once you click on Calibrate you can go to the calibration page.
  • Page 117 SunFounder PiCar-X Kit The calibration steps are as follows: 1. Once you get to the calibration page, there will be two prompt points telling you where to calibrate. Note: Calibrating is a micro-adjustment process. It is recommended to take the part off and reassem- ble it if you click a button to the limit and the part is still off.
  • Page 118 SunFounder PiCar-X Kit 2. Click on the left prompt point to calibrate the PiCar-X’s Pan-Tilt(the camera part). By using the two sets of buttons on the right, you can slowly adjust the Pan-Tilt’s orientation, as well as view their angles. When the adjustment is complete, click on Confirm.
  • Page 119 SunFounder PiCar-X Kit the front wheel facing straight ahead. When the adjustment is done, click on Confirm. Projects This section begins with basic programming functions for the PiCar-X, and continues through to creating more ad- vanced programs in Ezblock Studio. Each tutorial contains TIPS that introduce new functions, allowing users to write the corresponding program.
  • Page 120: Move

    SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 121 SunFounder PiCar-X Kit This block will make the PiCar-X move forward at a speed based on a percentage of available power. In the example below “50” is 50% of power, or half-speed. This block will make the PiCar-X move backward at a speed based on a percentage of available power.
  • Page 122 SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Chapter 6. Play with Ezblock...
  • Page 123: Remote Control

    SunFounder PiCar-X Kit Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team. • Learn & Share: Exchange tips and tutorials to enhance your skills. • Exclusive Previews: Get early access to new product announcements and sneak peeks.
  • Page 124 SunFounder PiCar-X Kit Drag a Joystick to the central area of the Remote Control page. Toggling the white point in the center, and gently dragging in any direction will produce an (X,Y) coordinate. The range of the X-axis or Y-axis is defaulted to “-100”...
  • Page 125: Test Ultrasonic Module

    SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 126 SunFounder PiCar-X Kit The Ultrasonic get distance block will read the distance from the PiCar-X to an obstacle directly ahead. This program is simplified with a Variable. For example, when there are multiple functions in a program that each need to use the distance to an obstacle, a Variable can be used to report the same distance value to each function, instead of each function reading the same value separately.
  • Page 127 • Or find the code with the same name on the Examples page of the EzBlock Studio and click Run or Edit directly. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 128: Test Grayscale Module

    SunFounder PiCar-X Kit • Exclusive Previews: Get early access to new product announcements and sneak peeks. • Special Discounts: Enjoy exclusive discounts on our newest products. • Festive Promotions and Giveaways: Take part in giveaways and holiday promotions. Ready to explore and create with us? Click [] and join today! 6.7 Test Grayscale Module...
  • Page 129: Color Detection

    SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 130 SunFounder PiCar-X Kit Note: The printed colors may have a slightly different hue from the Ezblock color models due to printer toner differ- ences, or the printed medium, such as a tan-colored paper. This can cause a less accurate color recognition.
  • Page 131 SunFounder PiCar-X Kit TIPS Drag the Video widget from the remote Control page, and it will generate a video monitor. For more information on how to use the Video widget, please reference the tutorial on Ezblock video here: How to Use the Video Function?.
  • Page 132: Face Detection

    • Or find the code with the same name on the Examples page of the EzBlock Studio and click Run or Edit directly. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 133 SunFounder PiCar-X Kit TIPS Set the face detection widget to on to enable facial detection. These two blocks are used to adjust the orientation of the pan-tilt camera, similar to driving the PiCar-X in the Remote tutorial. As the value increases, the camera will rotate to the right, or upwards, a decreasing value will rotate Control the camera right, or downwards.
  • Page 134 SunFounder PiCar-X Kit The image detection results are given through the of detected face block. Use the drop-down menu options to choose between reading the coordinates, size, or number of results from the image detection function. Use the create text with block to print the combination of text and of detected face data.
  • Page 135 SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 136: Sound Effect

    SunFounder PiCar-X Kit Ready to explore and create with us? Click [] and join today! 6.10 Sound Effect PiCar-X has a built-in speaker that can be used for audio experiments. Ezblock allows users to enter text to make the PiCar-X speak, or make specific sound effects. In this tutorial, the PiCar-X will make the sound of a gun firing after a 3-second countdown, using a do/while function.
  • Page 137: Background Music

    • Or find the code with the same name on the Examples page of the EzBlock Studio and click Run or Edit directly. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 138 • Or find the code with the same name on the Examples page of the EzBlock Studio and click Run or Edit directly. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 139: Say Hello

    SunFounder PiCar-X Kit • Special Discounts: Enjoy exclusive discounts on our newest products. • Festive Promotions and Giveaways: Take part in giveaways and holiday promotions. Ready to explore and create with us? Click [] and join today! 6.12 Say Hello This project will combine several functions from the preceding projects.
  • Page 140 SunFounder PiCar-X Kit The conditional statements block is used in conjunction with the if do block. The conditions can be “=”, “>”, “<”, ” “, ” “, or ” “. EXAMPLE Note: • You can write the program according to the following picture, please refer to the tutorial: How to Create a New Project?.
  • Page 141 SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. 6.12. Say Hello...
  • Page 142: Music Car

    SunFounder PiCar-X Kit Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team. • Learn & Share: Exchange tips and tutorials to enhance your skills. • Exclusive Previews: Get early access to new product announcements and sneak peeks.
  • Page 143: Cliff Detection

    SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 144 SunFounder PiCar-X Kit The grayscale module will be performing the same operation multiple times. To simplify the program, this project introduces a function that will return a list variable to the do forever block. EXAMPLE Note: • You can write the program according to the following picture, please refer to the tutorial: How to Create a New Project?.
  • Page 145 SunFounder PiCar-X Kit 6.14. Cliff Detection...
  • Page 146 SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 147: Minecart

    SunFounder PiCar-X Kit 6.15 Minecart Let’s make a minecart project! This project will use the Grayscale module to make the PiCar-X move forward along a track. Use dark-colored tape to make a track on the ground as straight as possible, and not too curved. Some experi- menting might be needed if the PiCar-X becomes derailed.
  • Page 148 SunFounder PiCar-X Kit Chapter 6. Play with Ezblock...
  • Page 149 SunFounder PiCar-X Kit 6.15. Minecart...
  • Page 150 SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 151: Minecart Plus

    SunFounder PiCar-X Kit 6.16 Minecart Plus In this project, derailment recovery has been added to the project to let the PiCar-X adapt and recover from Minecart a more severe curve. TIPS 1. Use another to do something block to allow the PiCar-X to back up and recover from a sharp curve. Note that the new to do something function does not return any values, but is used just for reorienting the PiCar-X.
  • Page 152 SunFounder PiCar-X Kit Chapter 6. Play with Ezblock...
  • Page 153 SunFounder PiCar-X Kit 6.16. Minecart Plus...
  • Page 154 SunFounder PiCar-X Kit Chapter 6. Play with Ezblock...
  • Page 155 SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 156: Bullfight

    SunFounder PiCar-X Kit 6.17 Bullfight Turn PiCar-X into an angry bull! Prepare a red cloth, such as a handkerchief, and become a Bullfighter. When the PiCar-X chases after the red cloth, be careful not to get hit! Note: This project is more advanced than the preceding projects. The PiCar-X will need to use the color detection function to keep the camera facing towards the red cloth, then the body orientation will need to automatically adjust in response to the direction that the camera is facing.
  • Page 157 • Or find the code with the same name on the Examples page of the EzBlock Studio and click Run or Edit directly. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 158: Beware Of Pedestrians

    SunFounder PiCar-X Kit • Exclusive Previews: Get early access to new product announcements and sneak peeks. • Special Discounts: Enjoy exclusive discounts on our newest products. • Festive Promotions and Giveaways: Take part in giveaways and holiday promotions. Ready to explore and create with us? Click [] and join today! 6.18 Beware of Pedestrians...
  • Page 159 • Or find the code with the same name on the Examples page of the EzBlock Studio and click Run or Edit directly. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 160: Traffic Sign Detection

    SunFounder PiCar-X Kit • Expert Support: Solve post-sale issues and technical challenges with help from our community and team. • Learn & Share: Exchange tips and tutorials to enhance your skills. • Exclusive Previews: Get early access to new product announcements and sneak peeks.
  • Page 161 SunFounder PiCar-X Kit • Or find the code with the same name on the Examples page of the EzBlock Studio and click Run or Edit directly. 6.19. Traffic Sign Detection...
  • Page 162 SunFounder PiCar-X Kit Chapter 6. Play with Ezblock...
  • Page 163 SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 164: Orienteering

    SunFounder PiCar-X Kit 6.20 Orienteering This project uses the remote control function to guide the PiCar-X through a competitive scavenger hunt! First, set up either an obstacle course, or a maze, or even an empty room that the PiCar-X can drive through. Then, randomly place six markers along the route, and put a color-card at each of the six markers for the PiCar-X to find.
  • Page 165 SunFounder PiCar-X Kit Take turns playing this game with friends to see who can help PiCar-X complete the objective the fastest! EXAMPLE Note: • You can write the program according to the following picture, please refer to the tutorial: How to Create a New Project?.
  • Page 166 SunFounder PiCar-X Kit Chapter 6. Play with Ezblock...
  • Page 167 SunFounder PiCar-X Kit 6.20. Orienteering...
  • Page 168 SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 169: Appendix

    CHAPTER SEVEN APPENDIX Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 170 SunFounder PiCar-X Kit Step 2: Connect to Raspberry Pi After a quick install open it up and now connect it to an FTP server. It has 3 ways to connect, here we use the Quick Connect bar. Enter the hostname/IP, username, password and port (22), then click Quick Connect or press Enter to connect to the server.
  • Page 171: Putty

    SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 172 SunFounder PiCar-X Kit Step 3 Click Open. Note that when you first log in to the Raspberry Pi with the IP address, there prompts a security reminder. Just click Yes. Step 4 When the PuTTY window prompts "login as:", type in "pi" (the user name of the RPi), and password: "raspberry"...
  • Page 173: Install Openssh Via Powershell

    Here, we get the Raspberry Pi connected and it is time to conduct the next steps. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 174 SunFounder PiCar-X Kit 2. Use the following command to install OpenSSH.Client. Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0 3. After installation, the following output will be returned. Path True Online False RestartNeeded : 4. Verify the installation by using the following command. Get-WindowsCapability -Online...
  • Page 175 SunFounder PiCar-X Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 176 SunFounder PiCar-X Kit Chapter 7. Appendix...
  • Page 177: Faq

    CHAPTER EIGHT 8.1 Q1: After installing Ezblock OS, the servo can’t turn to 0°? 1) Check if the servo cable is properly connected and if the Robot HAT power is on. 2) Press Reset button. 3) If you have already run the program in Ezblock Studio, the custom program for P11 is no longer available. You can refer to the picture below to manually write a program in Ezblock Studio to set the servo angle to 0.
  • Page 178: Q2: When Using Vnc, I Am Prompted That The Desktop Cannot Be Displayed At The Moment

    You can find a comprehensive tutorial about the Robot HAT here, including information on its hardware and API. • Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 179: Thank You

    CHAPTER NINE THANK YOU Thanks to the evaluators who evaluated our products, the veterans who provided suggestions for the tutorial, and the users who have been following and supporting us. Your valuable suggestions to us are our motivation to provide better products! Particular Thanks •...
  • Page 180 SunFounder PiCar-X Kit Chapter 9. Thank You...
  • Page 181: Copyright Notice

    CHAPTER COPYRIGHT NOTICE All contents including but not limited to texts, images, and code in this manual are owned by the SunFounder Company. You should only use it for personal study,investigation, enjoyment, or other non-commercial or nonprofit purposes, under therelated regulations and copyrights laws, without infringing the legal rights of the author and relevant right holders.

Table of Contents