# Picar-x/example/servo\_zeroing.py fails with an error

**URL:** <https://forum.sunfounder.com/t/picar-x-example-servo-zeroing-py-fails-with-an-error/603>\
**Category:** Robotic kit for Raspberry Pi\
**Created:** [October 22, 2023, 5:59pm UTC](https://forum.sunfounder.com/t/picar-x-example-servo-zeroing-py-fails-with-an-error/603 "2023-10-22T17:59:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PicarX\_Fan](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@PicarX\_Fan](https://forum.sunfounder.com/u/PicarX_Fan)\
**Post date:** [October 22, 2023, 5:59pm UTC](https://forum.sunfounder.com/t/picar-x-example-servo-zeroing-py-fails-with-an-error/603/1 "2023-10-22T17:59:51Z")

</div>

Raspberry Pi 4  
RasPiOS Buster (32-bit)  
PiCarX Order: #100005863

Followed the steps as documented here: [Servo Adjust — SunFounder picar-x documentation](https://docs.sunfounder.com/projects/picar-x/en/latest/python/python_start/py_servo_adjust.html)

While running command: sudo python3 servo\_zeroing.py  
Get the following error:  
/usr/lib/python3.7/importlib/\_bootstrap.py:219: RuntimeWarning: Your system is neon capable but pygame was not built with support for it. The performance of some of your blits could be adversely affected. Consider enabling compile time detection with environment variables like PYGAME\_DETECT\_AVX2=1 if you are compiling without cross compilation.  
return f(\*args, \*\*kwds)  
Set servo to zero  
Traceback (most recent call last):  
File “servo\_zeroing.py”, line 13, in   
Servo(i).angle(10)  
File “/usr/local/lib/python3.7/dist-packages/robot\_hat-1.0.4-py3.7.egg/robot\_hat/servo.py”, line 12, in **init**  
self.pwm.period(4095)  
AttributeError: ‘int’ object has no attribute ‘period’

Connecting the servo results in nothing.

---

<div class="post-metadata">

**Author:** ![PicarX\_Fan](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@PicarX\_Fan](https://forum.sunfounder.com/u/PicarX_Fan)\
**Post date:** [October 22, 2023, 7:22pm UTC](https://forum.sunfounder.com/t/picar-x-example-servo-zeroing-py-fails-with-an-error/603/2 "2023-10-22T19:22:55Z")

</div>

Issue Resolved.  
I re-installed robot-hat with the v2.0 branch switch:  
git clone **-b v2.0** [GitHub - sunfounder/robot-hat: Robot Hat python library](https://github.com/sunfounder/robot-hat.git)
