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

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

Author Avatar
PRO
Canada
#1  

Hello @j98221,

Unfortunately, you are correct, the pan and tilt hat communicates via I2C (found the pinout here). If you are able to setup those pins as regular GPIO maybe it could work with ARC. Otherwise, you may have to write an EZ-Script with I2C commands to make it work. Writing your own I2C commands is tricky business, but not impossible.

#2  

can i execute a python script from EZ-Script?

Author Avatar
PRO
Canada
#3  

It's theoretically possible. If you have a python script running on the Pi and it's waiting for a signal from ARC (like a high signal on GPIO7 for example) you could likely make it work. I don't have a code example for you but others here in the Synthiam community might be able to help.

#4  

i will look into executing a python script with parameters from ez-script. if anyone can help i would very much appreciate it.

Author Avatar
PRO
USA
#5  

@J98221,

I have a python solution compatible with ARC, I'll post more details later.

What model of Raspberry PI and Linux distro do you have ?

#6  

i have model 3 b+ running the latest distro which is buster.

thanks

Author Avatar
PRO
USA
#7  

@j98221: clone the repository on your raspberry pi home folder:

cd ~/
git clone https://github.com/ppedro74/BlueberryServer.git

edit the file to match your hat controller:

vi ~/BlueberryServer/Blueberry.Server.Python/Main.py

uncomment the line 158 (setup_i2c_PimoroniPanTiltHatServoController):

###Pimoroni Pan-Tilt HAT  https://shop.pimoroni.com/products/pan-tilt-hat
###Used to map servo ports D0..D1
setup_i2c_PimoroniPanTiltHatServoController(i2c_com)

start the server (EZB and Camera Server):

cd ~/BlueberryServer/Blueberry.Server.Python/
python3 Main.py

Then use the ARC connect to the Server (you can use the Antenna to discover  the address and port) add two servo controls D0 and D1 and test the movements.

PS: Due to limited time the instructions are minimal. I'll provide more details later.

#8  

after editing line 158 and saving the file, started EZB, then i started another terminal session and started cd ~/BlueberryServer/Blueberry.Server.Python/ python3 Main.py. i received the following error;

pi@saripi:~ $ cd /BlueberryServer/Blueberry.Server.Python/ pi@saripi:/BlueberryServer/Blueberry.Server.Python $ sudo python3 Main.py & [1] 1314 pi@saripi:~/BlueberryServer/Blueberry.Server.Python $ 1319-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 129, in setup_PyAudioPlayerController import PyAudioPlayerController File "/home/pi/BlueberryServer/Blueberry.Server.Python/PyAudioPlayerController.py", line 7, in import pyaudio ModuleNotFoundError: No module named 'pyaudio'