Don’t Touch Me¶
If you don’t meet PiSloth’s needs, it will get angry and stay away from your touch.
You can directly use this block to read the distance to the obstacle right ahead.
When assembling, Trig and Echo are connected to D2 and D3 respectively, you also need to change them simultaneously when programming.
To achieve conditional judgment of “if” type, you need to use an if do block.
When you need to implement multiple conditional judgments, you will have to change if do into if else do. This can be achieved by clicking on the setting icon.
You need to use a conditional statements block in conjunction with if do. Judging conditions can be “=”, “>”, “<”, “≥”, “≤”, “≠”.
A number block.
This block can emit some preset sound effects, such as siren sound, gun sound and so on. The range of volume is 1~100.
You can write the program according to the following picture, please refer to the tutorial: How to Create a New Project?
Or find the code with the same name on the Examples page of the EzBlock Studio and click Run or Edit directly.