Joystick (Xinput) icon Joystick (Xinput) XInput joystick skill for ARC: maps Xbox controllers to movement, servos, triggers, vibration, variables; supports analog inputs and scripts. Try it →
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 https://pimoroni.com/pantilthat

please help, Thank you in advance.



Related Hardware (view all EZB hardware)
Raspberry Pi by Pi Foundation
Run Synthiam ARC on Raspberry Pi 4+ with Windows 11 for robot control; use external EZB/Arduino for reliable I/O, SSD/USB storage recommended
Wi-Fi
Servos
Camera
Audio
UART
I2C
ADC
Digital

Related Robot Skills (view all robot skills)
Vertical Servo by Synthiam
Drag vertically to control a servo within set min/max limits; center, release, invert, and mirror to other servos. For 3-wire GVS servos.
Horizontal Servo by Synthiam
Mouse-drag horizontal servo control with configurable min/max limits, center/release functions, multi-servo mirroring and direction invert.
Real-time servo position input via Arduino ADC over I2C; supports Nano (6 channels) or Mega (16), configurable I2C address and scalable chaining.

ARC Pro

Upgrade to ARC Pro

Take control of your robot's destiny by subscribing to Synthiam ARC Pro, and watch it evolve into a versatile and responsive machine.

Author Avatar
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.

Author Avatar
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.

Author Avatar
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

Author Avatar
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.