-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from RogueM/commit
correction of dependencies in control file
- Loading branch information
Showing
8 changed files
with
85 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.