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

Discover the limitless potential of robot programming with Synthiam ARC Pro – where innovation and creativity meet seamlessly.

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

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?