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 ??

https://github.com/ccrisan/motioneyeos/issues/553

ThankZ at everyone

GreetZ
Joey

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

Joey

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:

LEFT.py
import time
import pantilthat
pantilthat.pan(90)
time.sleep(2)

LEFT
#!/bin/bash
sudo python2 LEFT.py

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

mmmh, it do not work