Skip to content

Documentation setup #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ Introduction
:target: https://travis-ci.org/adafruit/Adafruit_CircuitPython_pixie
:alt: Build Status

.. todo:: Describe what the library does.
.. A driver for Pixie - 3W Chainable Smart LED Pixel

Dependencies
=============
This driver depends on:

* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
* `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_
* `Register <https://github.com/adafruit/Adafruit_CircuitPython_Register>`_

Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
Expand All @@ -30,7 +28,38 @@ This is easily achieved by downloading
Usage Example
=============

.. todo:: Add a quick, simple example. It and other examples should live in the examples folder and be included in docs/examples.rst.
.. code-block::python

import time
import board
import adafruit_pixie
import busio

uart = busio.UART(board.TX, rx=None, baudrate=115200)

num_pixies = 2 # Change this to the number of Pixies LEDs you have.
pixies = adafruit_pixie.Pixie(uart, num_pixies, brightness=0.2, auto_write=False)


def wheel(pos):
# Input a value 0 to 255 to get a color value.
# The colours are a transition r - g - b - back to r.
if pos < 0 or pos > 255:
return 0, 0, 0
if pos < 85:
return int(255 - pos * 3), int(pos * 3), 0
if pos < 170:
pos -= 85
return 0, int(255 - pos * 3), int(pos * 3)
pos -= 170
return int(pos * 3), 0, int(255 - (pos * 3))


while True:
for i in range(255):
for pixie in range(num_pixies):
pixies[pixie] = wheel(i)
pixies.show()

Contributing
============
Expand Down
5 changes: 1 addition & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@ Table of Contents
.. toctree::
:caption: Tutorials

.. todo:: Add any Learn guide links here. If there are none, then simply delete this todo and leave
the toctree above for use later.

.. toctree::
:caption: Related Products

.. todo:: Add any product links here. If there are none, then simply delete this todo and leave
the toctree above for use later.
.. https://www.adafruit.com/product/2741

.. toctree::
:caption: Other Links
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
adafruit-circuitpython-busdevice
adafruit-circuitpython-register