# Action Buttons for Pimoroni Pan Tilt Hat in motionEyeOs

**URL:** <https://forums.pimoroni.com/t/action-buttons-for-pimoroni-pan-tilt-hat-in-motioneyeos/5271>\
**Category:** Support\
**Created:** [July 10, 2017, 5:51pm UTC](https://forums.pimoroni.com/t/action-buttons-for-pimoroni-pan-tilt-hat-in-motioneyeos/5271 "2017-07-10T17:51:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joey73](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/joey73/32/1861_2.png) [@Joey73](https://forums.pimoroni.com/u/Joey73)\
**Post date:** [July 10, 2017, 5:51pm UTC](https://forums.pimoroni.com/t/action-buttons-for-pimoroni-pan-tilt-hat-in-motioneyeos/5271/1 "2017-07-10T17:51:51Z")

</div>

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](https://github.com/ccrisan/motioneyeos/issues/553)

ThankZ at everyone

GreetZ  
Joey

---

<div class="post-metadata">

**Author:** ![Joey73](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/joey73/32/1861_2.png) [@Joey73](https://forums.pimoroni.com/u/Joey73)\
**Post date:** [July 12, 2017, 9:20am UTC](https://forums.pimoroni.com/t/action-buttons-for-pimoroni-pan-tilt-hat-in-motioneyeos/5271/2 "2017-07-12T09:20:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RaspberryPicardBox](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/raspberrypicardbox/32/7454_2.png) [@RaspberryPicardBox](https://forums.pimoroni.com/u/RaspberryPicardBox)\
**Post date:** [July 6, 2017, 12:52pm UTC](https://forums.pimoroni.com/t/action-buttons-for-pimoroni-pan-tilt-hat-in-motioneyeos/5271/3 "2017-07-06T12:52:05Z")

</div>

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](http://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! :)

---

<div class="post-metadata">

**Author:** ![Joey73](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/joey73/32/1861_2.png) [@Joey73](https://forums.pimoroni.com/u/Joey73)\
**Post date:** [July 19, 2017, 5:34am UTC](https://forums.pimoroni.com/t/action-buttons-for-pimoroni-pan-tilt-hat-in-motioneyeos/5271/4 "2017-07-19T05:34:39Z")

</div>

mmmh, it do not work
