Skip to content

Commit

Permalink
Merge pull request #1 from RogueM/commit
Browse files Browse the repository at this point in the history
correction of dependencies in control file
  • Loading branch information
Gadgetoid authored Nov 21, 2016
2 parents 78cb2e2 + d10b82e commit c39af1b
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 29 deletions.
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
#PanTilt HAT
#Pan-Tilt HAT

Pan-Tilt HAT is a two-channel servo driver designed to control a tiny servo-powered Pan/Tilt assembly. It also controls either PWM-dimmed lights or WS2812 pixels; up to 24 RGB or 18 RGBW.

##Installation

**Full install ( recommended ):**

We've created a super-easy installation script that will install all pre-requisites and get your HAT up and running in a jiffy. To run it fire up Terminal which you'll find in Menu -> Accessories -> Terminal on your Raspberry Pi desktop like so:

![Finding the terminal](terminal.jpg)

In the new terminal window type:

```bash
curl -sS https://get.pimoroni.com/pantilthat | bash
```

If you choose to download examples you'll find them in `/home/pi/Pimoroni/pantilthat/`.

**Library install for Python 3:**


```bash
sudo pip3 install pantilthat
```

**Library install for Python 2:**


```bash
sudo pip2 install pantilthat
```

In all cases you will have to enable the i2c bus.
10 changes: 7 additions & 3 deletions examples/grbw.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import pantilthat
import time
import math
#!/usr/bin/env python

import colorsys
import math
import time

import pantilthat


pantilthat.light_mode(pantilthat.WS2812)

Expand Down
20 changes: 12 additions & 8 deletions examples/neopixels.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
import pantilthat as pt
import time
import math
#!/usr/bin/env python

import colorsys
import math
import time

import pantilthat


pt.light_mode(pt.WS2812)
pantilthat.light_mode(pantilthat.WS2812)

while True:
t = time.time()
b = (math.sin(t * 2) + 1) / 2
b = int(b * 255.0)
t = round(time.time() * 1000) / 1000
a = round(math.sin(t) * 90)
pt.pan(int(a))
pt.tilt(int(a))
pantilthat.pan(int(a))
pantilthat.tilt(int(a))
r, g, b = [int(x*255) for x in colorsys.hsv_to_rgb(((t*100) % 360) / 360.0, 1.0, 1.0)]
pt.set_all(r, g, b)
pt.show()
pantilthat.set_all(r, g, b)
pantilthat.show()
print(a)
time.sleep(0.04)
16 changes: 10 additions & 6 deletions examples/smooth.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import pantilthat as pt
import time
#!/usr/bin/env python

import math
import time

import pantilthat


pt.light_mode(pt.PWM)
pantilthat.light_mode(pantilthat.PWM)

while True:
b = (math.sin(time.time() * 2) + 1) / 2
b = int(b * 255.0)
t = round(time.time() * 1000) / 1000
a = round(math.sin(t) * 90)
pt.pan(int(a))
pt.tilt(int(a))
pt.brightness(b)
pantilthat.pan(int(a))
pantilthat.tilt(int(a))
pantilthat.brightness(b)
print(a)
time.sleep(0.04)
6 changes: 3 additions & 3 deletions packaging/debian/README
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
README

PanTilt HAT controls two servos and WS2812 or PWM-dimmed LEDs.
Pan-Tilt HAT controls two servos and WS2812 or PWM-dimmed LEDs.

Ideal for adding a Pan/Tilt camera to your Pi.

Learn more: https://shop.pimoroni.com/products/pantilthat
For examples run: `curl -sS get.pimoroni.com/pantilthat | bash`
Learn more: https://shop.pimoroni.com/products/pan-tilt-hat
For examples run: `curl -sS https://get.pimoroni.com/pantilthat | bash`
16 changes: 8 additions & 8 deletions packaging/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ X-Python3-Version: >= 3.4
Package: python-pantilthat
Architecture: all
Section: python
Depends: ${misc:Depends}, ${python:Depends}, python-rpi.gpio
Suggests: python-psutil, python-requests
Description: python library designed to control PanTilt HAT
PanTilt HAT controls two servos and WS2812 or PWM-dimmed LEDs.
Depends: ${misc:Depends}, ${python:Depends}, python-smbus
Suggests: python-picamera
Description: python library designed to control Pan-Tilt HAT
Pan-Tilt HAT controls two servos and WS2812 or PWM-dimmed LEDs.
Ideal for adding a Pan/Tilt camera to your Pi.
.
This is the Python 2 version of the package.

Package: python3-pantilthat
Architecture: all
Section: python
Depends: ${misc:Depends}, ${python3:Depends}, python3-rpi.gpio
Suggests: python3-psutil, python3-requests
Description: python library designed to control PanTilt HAT
PanTilt HAT controls two servos and WS2812 or PWM-dimmed LEDs.
Depends: ${misc:Depends}, ${python3:Depends}, python3-smbus
Suggests: python3-picamera
Description: python library designed to control Pan-Tilt HAT
Pan-Tilt HAT controls two servos and WS2812 or PWM-dimmed LEDs.
Ideal for adding a Pan/Tilt camera to your Pi.
.
This is the Python 3 version of the package.
10 changes: 10 additions & 0 deletions packaging/makeall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ reponame="" # leave this blank for auto-detection
libname="" # leave this blank for auto-detection
packagename="" # leave this blank for auto-selection

rpigpio="no" # set to 'no' to turn off warning
smbus="yes" # set to 'no' to turn off warning

debianlog="debian/changelog"
debcontrol="debian/control"
debcopyright="debian/copyright"
Expand Down Expand Up @@ -121,6 +124,13 @@ if ! grep "^Priority: extra" $debcontrol &> /dev/null; then
warning "$(grep "^Priority" $debcontrol)" && FLAG=true
fi

if [ $rpigpio == "yes" ] && ! grep "rpi.gpio" $debcontrol &> /dev/null; then
warning "if this library does not depend on rpi.gpio change 'rpigpio' variable!" && FLAG=true
fi

if [ $smbus == "yes" ] && ! grep "smbus" $debcontrol &> /dev/null; then
warning "if this library does not depend on smbus change the 'smbus' variable!" && FLAG=true
fi

# checking debian/rules file

Expand Down
Binary file added terminal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c39af1b

Please sign in to comment.