From 16827db5befc7dc443ef7305044dc9304695ae7a Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Fri, 10 Aug 2018 11:04:32 +0000 Subject: [PATCH] README and Makefile --- Makefile | 39 +++++++++++++++++++++++++++++++++++++++ README.md | 16 ++++++++++++++++ library/README.rst | 21 +++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 Makefile create mode 100644 README.md diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e1ffcf4 --- /dev/null +++ b/Makefile @@ -0,0 +1,39 @@ +.PHONY: usage install uninstall +usage: + @echo "Usage: make , where target is one of:\n" + @echo "install: install the library locally from source" + @echo "uninstall: uninstall the local library" + @echo "python-readme: generate library/README.rst from README.md" + @echo "python-wheels: build python .whl files for distribution" + @echo "python-sdist: build python source distribution" + @echo "python-clean: clean python build and dist directories" + @echo "python-dist: build all python distribution files" + +install: + ./install.sh + +uninstall: + ./uninstall.sh + +python-readme: library/README.rst + +library/README.rst: README.md + pandoc --from=markdown --to=rst -o library/README.rst README.md + +python-wheels: + cd library; python3 setup.py bdist_wheel + cd library; python setup.py bdist_wheel + +python-sdist: + cd library; python setup.py sdist + +python-clean: + -rm -r library/dist + -rm -r library/build + -rm -r library/*.egg-info + +python-dist: python-clean python-readme python-wheels python-sdist + ls library/dist + +python-deploy: python-dist + twine upload library/dist/* diff --git a/README.md b/README.md new file mode 100644 index 0000000..e281c6b --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# LTR559 Proximity/Presence/Light Sensor + +Suitable for detecting proximity of an object at close range the LTR559 is great for approach detection and ambient light compensation. The range is useful to around 2cm, and this is the type of sensor you might find in a smartphone to determine if you're holding it against your head. + +# Installing + +Stable library from PyPi: + +* Just run `sudo pip install ltr559` + +Latest/development library from GitHub: + +* `git clone https://github.com/pimoroni/ltr559-python` +* `cd ltr559-python` +* `sudo ./install.sh` + diff --git a/library/README.rst b/library/README.rst index e69de29..9f7683c 100644 --- a/library/README.rst +++ b/library/README.rst @@ -0,0 +1,21 @@ +LTR559 Proximity/Presence/Light Sensor +====================================== + +Suitable for detecting proximity of an object at close range the LTR559 +is great for approach detection and ambient light compensation. The +range is useful to around 2cm, and this is the type of sensor you might +find in a smartphone to determine if you're holding it against your +head. + +Installing +========== + +Stable library from PyPi: + +- Just run ``sudo pip install ltr559`` + +Latest/development library from GitHub: + +- ``git clone https://github.com/pimoroni/ltr559-python`` +- ``cd ltr559-python`` +- ``sudo ./install.sh``