Skip to content

Latest commit

 

History

History
50 lines (28 loc) · 2.13 KB

ezblock_sound_effect.rst

File metadata and controls

50 lines (28 loc) · 2.13 KB

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!

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.

TIPS

img/sp210512_144106.png

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.

img/sp210512_144150.png

The number block.

img/sp210512_144216.png

Using the repeat block will repeatedly execute the same statement, which reduces the size of the code.

img/sp210512_144418.png

The mathematical operation block can perform typical mathematical functions, such as ”+”, “-”, “x”, and “÷ “.

img/sp210512_144530.png

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.

img/sp210512_144944.png