Action Buttons for Pimoroni Pan Tilt Hat in motionEyeOs

Hi FolkZ,

can anybody help me to build Action Buttons in motionEyeOs for the Pimoroni Pan Tilt Hat?

I have no idea how i can build such Action Buttons ??
Can anyone help me coding such a script ??

ThankZ at everyone


Hi FolkZ,

is it possible to add Action Buttons in Motioneyeos to control the Pimoroni PanTiltHat?

Has someone an Idea or code for These Action Buttons?

Greetz from Germany


Hallo Joey,
First off, I’ve never used Motioneyeos before, so I apologise for the terrible method in which I go about solving this. Secondly, I’m looking only at the wiki page for Motioneyeos for my ideas, so if there’s any mis-match in what’s really there then have a go tweaking around everything.
Anyway, it looks like the action buttons just run bash straight up, yes? SInce the PanTiltHat is grounded mostly in Python (and since it’s my favourite language), it should be simple enough to set up four Python files that include code to move the hat in it’s respective axis for a set amount of time, which are then ran by the bash code from the action buttons. For instance:
import time
import pantilthat

sudo python2

Again, sorry if this is a complete waste of time, but I hope it works anyway! :)

mmmh, it do not work