PanTiltHat & Curses control


#1

I have been watching on YouTube "Raspberry Pi Pan Tilt Camera Guide"by TuckerShannon how to control a kind of pantilthat using arrow keys. It differs from Pimoronis pantilthat in such way that servos are connected directly to GPIO-pins 7 and 11 and running pantilt.py using arrowkeys. I have been struggling last four days to get it alive. I get camerapreview, I can see up-down-left-right on he screen, pushing “p” takes a snapshot. Everything else works except servos are NOT moving. I think the problem is related to get servoblaster installed correctly. The pantilt.py script contains two rows that confuses me:

  • #use code “python pantilt.py” after you cd into the correct folder!
  • #activating servo blaster (servod must be in the same folder as this script!)”

I have used a fresh Full Stretch 2017-11-29 and installed pantilthat OneLine Installer and PiBits servoblaster from GitHub which all seem to install correctly, but thats my impression I could be mistaking on this point. “ls /dev/servoblaster” is ok also sudo ./servod show list of available GPIO-pins.
Trying command line “echo N=100 > dev/servoblaster” doesnot move any servo for testing purpose. (N refers to GPIO# in servod listing).
The YouTube video refers back to 2016 when Stretch was not released ? Could that be my problem ?
I am using the Pimoroni complete pantilthat board on top of RPi3B, servos connected to the board. Is that a problem ?
Any guidance appreciated…
Thanx In Advance
calleblyh


#2

PanTilt HAT uses a PIC-based servo driver, and the servos themselves are not directly connected to any GPIO pin on the Pi. It wont work with servo blaster (deliberately so, since the Pi is terrible at controlling servos).

You would have to modify the code to control PanTilt HAT via the driver, or via the Python library.


#3

This problem has been solved. I found the solution on https://github.com/richardghirst/PiBits/issues/91