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

Unleash your robot's full potential with the cutting-edge features and intuitive programming offered by Synthiam ARC Pro.

Author Avatar
PRO
USA
#9  

you need to install the pyaudio module:

sudo apt-get install python3-pyaudio
#10  

fyi, i just tried to run both in the same terminal session, and i received the same error.

#11  

i install pyaudio, i now received the following error

pi@saripi:/BlueberryServer/Blueberry.Server.Python $ sudo python3 Main.py & [3] 1268 pi@saripi:/BlueberryServer/Blueberry.Server.Python $ 1273-root-INFO-Starting... platform=linux hostname=saripi Traceback (most recent call last): File "Main.py", line 178, in main() File "Main.py", line 139, in main setup_PyAudioPlayerController() File "Main.py", line 132, in setup_PyAudioPlayerController com.start() File "/usr/lib/python3.7/contextlib.py", line 239, in helper return _GeneratorContextManager(func, args, kwds) File "/usr/lib/python3.7/contextlib.py", line 82, in init self.gen = func(*args, **kwds) File "/home/pi/BlueberryServer/Blueberry.Server.Python/PyAudioPlayerController.py", line 82, in start start=False) File "/usr/lib/python3/dist-packages/pyaudio.py", line 750, in open stream = Stream(self, *args, **kwargs) File "/usr/lib/python3/dist-packages/pyaudio.py", line 441, in init self._stream = pa.open(**arguments) OSError: [Errno -9997] Invalid sample rate

#12  

my python version is 3.7.3-1

Author Avatar
PRO
USA
#13   — Edited

There is an issue with Buster and portaudio library you will need to edit your shell script:

vi ~/.bashrc

add the following line to the end:

export PA_ALSA_PLUGHW=1

you can reboot or reload the shell (previous changes):

source ~/.bashrc

if you want audio through the audio jack:

sudo amixer cset numid=3 1
#14  

i now get the following error

pi@saripi:/BlueberryServer/Blueberry.Server.Python $ sudo python3 Main.py 1272-root-INFO-Starting... platform=linux hostname=saripi Traceback (most recent call last): File "Main.py", line 178, in main() File "Main.py", line 139, in main setup_PyAudioPlayerController() File "Main.py", line 132, in setup_PyAudioPlayerController com.start() File "/usr/lib/python3.7/contextlib.py", line 239, in helper return _GeneratorContextManager(func, args, kwds) File "/usr/lib/python3.7/contextlib.py", line 82, in init self.gen = func(*args, **kwds) File "/home/pi/BlueberryServer/Blueberry.Server.Python/PyAudioPlayerController.py", line 82, in start start=False) File "/usr/lib/python3/dist-packages/pyaudio.py", line 750, in open stream = Stream(self, *args, **kwargs) File "/usr/lib/python3/dist-packages/pyaudio.py", line 441, in init self._stream = pa.open(**arguments) OSError: [Errno -9997] Invalid sample rate pi@saripi:/BlueberryServer/Blueberry.Server.Python $

#15  

i did make the changes as you illustrated. i also just for fun added a horiz servo. tried D0 and D1- as expected the servo did not respond. also just wanted to say thanks for your effort!

#16  

can i connect the servo directly to the rpi?

if yes which gpio pin coresponds to D0?