# How do I wire the PiSloth servos to the Robot Hat?

**URL:** <https://forum.sunfounder.com/t/how-do-i-wire-the-pisloth-servos-to-the-robot-hat/895>\
**Category:** General\
**Created:** [February 29, 2024, 5:27pm UTC](https://forum.sunfounder.com/t/how-do-i-wire-the-pisloth-servos-to-the-robot-hat/895 "2024-02-29T17:27:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Princess](https://avatars.discourse-cdn.com/v4/letter/p/e0b2c6/32.png) [@Princess](https://forum.sunfounder.com/u/Princess)\
**Post date:** [February 29, 2024, 5:27pm UTC](https://forum.sunfounder.com/t/how-do-i-wire-the-pisloth-servos-to-the-robot-hat/895/1 "2024-02-29T17:27:03Z")

</div>

How do I wire the PiSloth servos to the Robot Hat?  
I have checked every video and tutorial without any success.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [March 1, 2024, 3:35am UTC](https://forum.sunfounder.com/t/how-do-i-wire-the-pisloth-servos-to-the-robot-hat/895/2 "2024-03-01T03:35:15Z")

</div>

You are using ezblock app control, you need to install and download our specified ezblock OS image, burn it to SD card and plug it to Raspberry Pi. [EzblockStudio/download](https://ezblock.cc/download/v31.html)

1. First, start the robot and wait for it to turn on, if you hear a loud sound, it means the robot has been successfully turned on.

2. will upset the angle of the servo, connected to the p11 pin 3, and then hold down the USR key do not let go, and then press the zero RST key, you can wait for the servo back to zero. (Hint: before the servo is not zeroed, press and hold the USR key and don’t let go) If you use python control, you need to install and download the Raspberry Pi operating system, download and install the source code on the terminal, and execute the script for servo zeroing, and before executing the script, you need to disrupt the angle of the servo to connect to the P11, and execute the script: cd ~/pisloth/examplesudo python3 servo\_zeroing.py At this point you will see the servo in the return to zero

---

<div class="post-metadata">

**Author:** ![Princess](https://avatars.discourse-cdn.com/v4/letter/p/e0b2c6/32.png) [@Princess](https://forum.sunfounder.com/u/Princess)\
**Post date:** [March 1, 2024, 6:14pm UTC](https://forum.sunfounder.com/t/how-do-i-wire-the-pisloth-servos-to-the-robot-hat/895/3 "2024-03-01T18:14:24Z")

</div>

Thank you for sharing the information about zeroing the servos, but I’m actually looking for where to connect the servos to the Robot Hat.  
Do I connect PWM0 - left leg, PWM1 - left ankle, PWM2 - right leg, PWM3 - right ankle?  
I can’t find any documentation showing this.

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [March 6, 2024, 8:10am UTC](https://forum.sunfounder.com/t/how-do-i-wire-the-pisloth-servos-to-the-robot-hat/895/4 "2024-03-06T08:10:51Z")

</div>

You can check out our assembly foldout, we have instructions on where to attach each servo!  
[https://github.com/sunfounder/sf-pdf/raw/master/assembly\_file/a0000691-pisloth.pdf](https://github.com/sunfounder/sf-pdf/raw/master/assembly_file/a0000691-pisloth.pdf)  
If the PiSloth is facing us:  
PWM2 - left leg  
PWM3 - left ankle  
PWM0 - right leg  
PWM1 - right ankle

 ![2024030601](https://canada1.discourse-cdn.com/flex029/uploads/sunfounder/original/1X/c6aa71a272c3cb659c10dbbd573a8a9169a0388a.png)

The opposite is true:  
PWM0 - left leg  
PWM1 - left ankle  
PWM2 - right leg  
PWM3 - right ankle

---

<div class="post-metadata">

**Author:** ![Princess](https://avatars.discourse-cdn.com/v4/letter/p/e0b2c6/32.png) [@Princess](https://forum.sunfounder.com/u/Princess)\
**Post date:** [March 7, 2024, 12:18am UTC](https://forum.sunfounder.com/t/how-do-i-wire-the-pisloth-servos-to-the-robot-hat/895/5 "2024-03-07T00:18:51Z")

</div>

Thank you for the info! This makes sense, now.

---

<div class="post-metadata">

**Author:** ![Princess](https://avatars.discourse-cdn.com/v4/letter/p/e0b2c6/32.png) [@Princess](https://forum.sunfounder.com/u/Princess)\
**Post date:** [March 7, 2024, 12:37am UTC](https://forum.sunfounder.com/t/how-do-i-wire-the-pisloth-servos-to-the-robot-hat/895/6 "2024-03-07T00:37:32Z")

</div>

Now that I have everything connected, I am unable to zero the servos. This is the error that I get:

sudo python3 servo\_zeroing.py  
bash: cd: /home/pi/piarm/examples: No such file or directory  
python3: can’t open file ‘/home/jennifer/pisloth/servo\_zeroing.py’: [Errno 2] No such file or directory

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [March 7, 2024, 3:54am UTC](https://forum.sunfounder.com/t/how-do-i-wire-the-pisloth-servos-to-the-robot-hat/895/7 "2024-03-07T03:54:24Z")

</div>

I’m very sorry, but there is a problem with the command path of our tutorial, which is causing the error. You can run the examples by following the commands below:  
cd ~/pisloth/examples  
sudo python3 servo\_zeroing.py

---

<div class="post-metadata">

**Author:** ![Princess](https://avatars.discourse-cdn.com/v4/letter/p/e0b2c6/32.png) [@Princess](https://forum.sunfounder.com/u/Princess)\
**Post date:** [March 7, 2024, 1:22pm UTC](https://forum.sunfounder.com/t/how-do-i-wire-the-pisloth-servos-to-the-robot-hat/895/8 "2024-03-07T13:22:17Z")

</div>

![Screenshot 2024-03-07 at 8.21.14 AM](https://canada1.discourse-cdn.com/flex029/uploads/sunfounder/original/1X/8077083bde929330ddf9157ebba2c6b736bce369.png)

There is no “servo\_zeroing.py” in the source files…

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [March 8, 2024, 8:03am UTC](https://forum.sunfounder.com/t/how-do-i-wire-the-pisloth-servos-to-the-robot-hat/895/9 "2024-03-08T08:03:12Z")

</div>

The code we are using is not the master branch, but the V2.0 branch.

 ![2024030802](https://canada1.discourse-cdn.com/flex029/uploads/sunfounder/original/1X/07193fba79ed8c8b9d69beab950e6e38e9b960f7.png)
