Asked — Edited

Pimoroni Pan And Tilt HAT For Rpi 3 B+

hi

i just purchased the pan tilt hat. i know it works because i tried the python examples.

But how can i get ARC to recognize it?

I do have the ez server installed on the rpi with a camera, it connects, i tried the camera control example and the video works. i added the vertical servo, tried to set it up as D0, D1 and D2. neither will control the pan and tilt hat. i believe the pan and tilt works of of i2C but i am not certain.

information on the pan and tilt hat can be found at http://pimoroni.com/pantilthat

please help, Thank you in advance.


Related Hardware Raspberry Pi

ARC Pro

Upgrade to ARC Pro

With ARC Pro, your robot is not just a machine; it's your creative partner in the journey of technological exploration.

PRO
USA
#17   — Edited

Quote:

can i connect the servo directly to the rpi?
No, the pan and tilt works through I2C, the hat has a micro-controller (maybe a PIC) with a custom firmware that handles the I2C protocol.

Please update the code:

cd ~/BlueberryServer/Blueberry.Server.Python/
git pull

Then run the following:

python3 PimoroniPanTiltHatServoController.py

Check if the pan & tilt servos move.

#18  

yes they did move horizontilay to one side and vertically point upwards. then it stopped moving.

PRO
USA
#19  

So my code is working, should work from ARC.  Maybe you're missing something, I'll post more details in couple minutes.

#20  

i did try main.py again, but i received the same error.

PRO
USA
#21  

error ?

Quote:

OSError: [Errno -9997] Invalid sample rate
Is the above error post#14 ?

If yes is audio related you can comment line 139 on Main.py:

#setup_PyAudioPlayerController()

and let me know if it works.

#22  

no errors but nothing is happening. i added a horiz and vert servo to ARC. set horiz to D0 and vert to D1. min =1 max = 180. tried moving the servos using the control, but the servo does not respond. below is what i get when i execute main.py;

pi@saripi:~/BlueberryServer/Blueberry.Server.Python $ sudo python3 Main.py 1124-root-INFO-Starting... platform=linux hostname=saripi 1124-DeviceI2CController-1-21-DEBUG-write: bytearray(b'\x00\x08') 1124-EZBTcpServer-DEBUG-starting up on ('', 10023) 1124-EZBTcpServer-DEBUG-waiting for a connection 1124-EZBTcpServerUdpBroadcaster-DEBUG-Starting port=4242 1124-EZBTcpServerUdpBroadcaster-DEBUG-running.... 1124-EZBTcpServerUdpBroadcaster-DEBUG-broadcaster ip4 addresses found:['192.168. 8.239'] 1124-EZBCameraUdpBroadcaster-DEBUG-Starting port=4242 1124-EZBCameraUdpBroadcaster-DEBUG-running.... 1124-EZBCameraUdpBroadcaster-DEBUG-broadcaster ip4 addresses found:['192.168.8.2 39'] 1124-FakeCameraController-DEBUG-running thread:Thread-4 1124-EZBCameraTcpServer-DEBUG-starting up on ('', 10024) 1124-EZBCameraTcpServer-DEBUG-waiting for a connection ===> Press Enter to quit... 1124-EZBTcpServer-DEBUG-waiting for a connection 1124-EZBCameraTcpServer-DEBUG-waiting for a connection

PRO
USA
#23  

I don't see a connection from ARC, I'll take some pictures to guide you.

#24  

I had tried starting ezbpi server first, when that didn't work I rebooted and tried main.py first but no good on either.

Again I appreciate your help.