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!


PiCrawler can assume a specific posture by writing a coordinate array. Here it assumes a raised right rear foot posture.


Run the Code

cd /home/pi/picrawler/examples
sudo python3


from picrawler import Picrawler
from time import sleep

crawler = Picrawler([10,11,12,4,5,6,1,2,3,7,8,9])

## [right front],[left front],[left rear],[right rear]
new_step=[[50, 50, -80], [50, 50, -80],[80, 80, 0], [50, 50, -80]]

def main():

    speed = 100

    while True:


if __name__ == "__main__":

How it works?

In this code, the code you need to pay attention to is this crawler.do_step().

Similar to do_action(), do_step() can also manipulate PiCrawler’s behavior. The difference is that the former can perform the continuous behavior of move forward, while the latter can be used to make separate gestures of stand and sit.

It has two uses:

One: It can write strings, directly use the step_list dictionary in the picrawler library.

# "speed" indicates the speed of the step, the range is 0~100.

Second: It can also write an array of 4 coordinate values.

crawler.do_step([[50, 50, -80], [50, 50, -80],[80, 80, 0], [50, 50, -80]],speed)
# These four coordinates are used to control the four legs of right front, left front, left rear, and left rear respectively.

Each foot has an independent coordinate system. As shown below:


You need to measure the coordinates of each toe individually. As shown below:


By the way: the step_list called in the first method also consists of an array containing 4 coordinate values.

step_list = {
        [50, 50, -80],
        [50, 50, -80],
        [50, 50, -80],
        [50, 50, -80]
        [50, 50, -33],
        [50, 50, -33],
        [50, 50, -33],
        [50, 50, -33]