This repository has been archived by the owner on Feb 28, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 100
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 #10 from actuino/unicorn-dev3
Python 2 dev image for the Unicorn HAT or pHAT
- Loading branch information
Showing
3 changed files
with
56 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM alexellis2/python2-armhf:2 | ||
ENTRYPOINT [] | ||
RUN apt-get -qy update && apt-get -qy --no-install-recommends install git python-dev python-pip build-essential | ||
WORKDIR /root/ | ||
RUN git clone https://github.com/pimoroni/unicorn-hat | ||
# But install via pip | ||
RUN pip install unicornhat && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
apt-get -qy clean all | ||
|
||
WORKDIR /root/unicorn-hat/examples/ | ||
|
||
CMD ["/bin/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
NS = alexellis2 | ||
VERSION ?= 2-dev | ||
REPO = python2-unicornhat-armhf | ||
|
||
.PHONY: build push shell run start stop rm release | ||
|
||
build: | ||
docker build -t $(NS)/$(REPO):$(VERSION) . | ||
push: | ||
docker push $(NS)/$(REPO):$(VERSION) | ||
|
||
default: build | ||
|
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Unicorn HAT | ||
================================================ | ||
|
||
This image includes a full Python 2.7 dev stack, with `pip` as well as `git` and `build-essentials`. (not optimised for size) | ||
|
||
The Pimoroni library for Unicorn HAT and pHAT is installed. | ||
|
||
This image has to be run with the `--privileged` option like so: | ||
|
||
docker run -it --privileged alexellis2/python2-unicornhat-dev:2 | ||
|
||
The library can auto-detect if you're using a Unicorn HAT or a Unicorn pHAT. | ||
|
||
The default dir is the examples one, so you can test drive the demos, for instance: | ||
|
||
python rainbow.py | ||
|
||
See the full [examples listing](https://github.com/pimoroni/unicorn-hat/tree/master/examples) | ||
|
||
Note that some examples require extra Python libs that were not included (Numpy is one) | ||
|
||
About the Unicorn HAT and pHAT | ||
------------------------------ | ||
The Unicorn is a Raspberry Pi add on that provides a nice array of (very bright) RGB LEDs. | ||
Those are individually addressable WS2812B LEDs. | ||
|
||
It's made by [Pimoroni](https://shop.pimoroni.com) and comes in two flavors: | ||
|
||
* The [Unicorn pHAT](http://shop.pimoroni.com/products/unicorn-phat) I used, 8x4 LEDs, will nicely fit your Raspberry Pi Zero | ||
* The [Unicorn HAT](http://shop.pimoroni.com/products/unicorn-hat) is dedicated to the bigger Raspberry Pi 2 and 3, and comes with 8x8 LEDs |