Custom Action

In the previous project, we were able to give PiSloth custom steps, so how do we combine these steps into actions?

For example, have PiSloth make the step from the previous project and then return to the initial position.

../_images/diy_pic.jpg

Note

You can download and print the PDF Cartoon Mask for your PiSloth.

TIPS

Create a variable up_down to store this action.

../_images/up_down.png

You can use the create action block to make PiSloth do this action. These values ​​represent the angles of the 4 Servos on the PiSloth. The range is (-90~90).

../_images/DIY2.png

Here you can increase or decrease the number of items by dragging it.

../_images/DIY3.png

Fill in the angle obtained in the previous project and name this action up_down (drag it from Variables category).

../_images/diy_up.png

Use the do block to make PiSloth do this action once at 50% speed.

../_images/DIY6.png

EXAMPLE

Note

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

../_images/DIY7.png