I’ve had my Pan/Tilt hat working fine for a while now. This morning it refuses to work. When I turn the Pi on, the camera moves down and left. If I run a script to move the hat by 5 degrees I get:
Traceback (most recent call last): File "./down_1", line 4, in <module> zpos = pantilthat.get_tilt() File "/usr/lib/python2.7/dist-packages/pantilthat/pantilt.py", line 449, in get_servo_two return self._servo_us_to_degrees(us, us_min, us_max) File "/usr/lib/python2.7/dist-packages/pantilthat/pantilt.py", line 148, in _servo_us_to_degrees self._check_range(us, us_min, us_max) File "/usr/lib/python2.7/dist-packages/pantilthat/pantilt.py", line 137, in _check_range max=value_max)) ValueError: Value 51200 should be between 575 and 2325
This is the script I’m using:
#!/usr/bin/env python import pantilthat import time zpos = pantilthat.get_tilt() if zpos < 90: pantilthat.tilt(zpos+5) else: zpos = zpos print "Here: ",zpos time.sleep(1)
I’ve recently been messing with some other Python and installed some other libraries - mainly to do with BLE detection. Is it possible I’ve messed something up? I’ve also added Apache support for Python.
If push comes to shove, I’ll flash the card and start again but I’d like to get to the bottom of this if possible.