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.

  • 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.

👉 Ready to explore and create with us? Click [here] and join today!

Move

This first project teaches how to program movement actions for the PiCar-X. In this project, the program will tell the PiCar-X to execute five actions in order: “forward”, “backward”, “turn left”, “turn right”, and “stop”.

To learn the basic usage of Ezblock Studio, please read through the following two sections:

  • ezblock:create_project_latest

../_images/move.png

TIPS

../_images/sp210512_113300.png

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.

../_images/sp210512_113418.png

This block will make the PiCar-X move backward at a speed based on a percentage of available power.

../_images/sp210512_113514.png

This block adjusts the orientation of the front wheels. The range is “-45” to ”45”. In the example below, “-30” means the wheels will turn 30° to the left.

../_images/BLK_Basic_delay.png

This block will cause a timed break between commands, based on milliseconds. In the example below, the PiCar-X will wait for 1 second (1000 milliseconds) before executing the next command.

../_images/sp210512_113550.png

This block will bring the PiCar-X to a complete stop.

EXAMPLE

Note

  • You can write the program according to the following picture, please refer to the tutorial: ezblock:create_project_latest.

  • Or find the code with the same name on the Examples page of the EzBlock Studio and click Run or Edit directly.

../_images/sp210512_113827.png