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 [|link_sf_facebook|] and join today!
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.
TIPS
Use the say block with a text block to write a sentence for the PiCar-X to say. The say block can be used with text or numbers.
The number block.
Using the repeat block will repeatedly execute the same statement, which reduces the size of the code.
The mathematical operation block can perform typical mathematical functions, such as ”+”, “-”, “x”, and “÷ “.
The play sound effects - with volume - % block has preset sound effects, such as a siren sound, a gun sound, and others. The range of the volume can be set from 0 to 100.
EXAMPLE
Note
- You can write the program according to the following picture, please refer to the tutorial: :ref:`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.