Skip to content

Commit 5bc5b7b

Browse files
committed
readthedocs stuff in progress and readme updates
1 parent 82a0178 commit 5bc5b7b

File tree

13 files changed

+399
-2
lines changed

13 files changed

+399
-2
lines changed

.readthedocs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
python:
2+
version: 3
3+
install:
4+
- requirements: docs/requirements.txt
5+
setup_py_install: true

DESCRIPTION.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Qwiic Dual Encoder Reader
2+
==========================
3+
4+
This package provides support to use three varieties of the SparkFun SerLCD screens: 16x2 SerLCD - RGB Backlight (QWIIC), 16x2 SerLCD - RGB Text (QWIIC), and 20x4 SerLCD - RGB Backlight (QWIIC).

LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2020 SparkFun Electronics
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 145 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,145 @@
1-
# Qwiic_SerLCD_Py
2-
Python module for I2C control of the SparkFun Qwiic Serial LCDs
1+
Qwiic_SerLCD_Py
2+
==============
3+
4+
<p align="center">
5+
<img src="https://cdn.sparkfun.com/assets/custom_pages/2/7/2/qwiic-logo-registered.jpg" width=200>
6+
<img src="https://www.python.org/static/community_logos/python-logo-master-v3-TM.png" width=240>
7+
</p>
8+
<p align="center">
9+
<a href="https://pypi.org/project/sparkfun-qwiic-serlcd/" alt="Package">
10+
<img src="https://img.shields.io/pypi/pyversions/sparkfun_qwiic_serlcd.svg" /></a>
11+
<a href="https://github.com/sparkfun/Qwiic_SerLCD_Py/issues" alt="Issues">
12+
<img src="https://img.shields.io/github/issues/sparkfun/Qwiic_SerLCD_Py.svg" /></a>
13+
<a href="https://qwiic-serlcd-py.readthedocs.io/en/latest/" alt="Documentation">
14+
<img src="https://readthedocs.org/projects/qwiic-serlcd-py/badge/?version=latest&style=flat" /></a>
15+
<a href="https://github.com/sparkfun/Qwiic_SerLCD_Py/blob/master/LICENSE" alt="License">
16+
<img src="https://img.shields.io/badge/license-MIT-blue.svg" /></a>
17+
<a href="https://twitter.com/intent/follow?screen_name=sparkfun">
18+
<img src="https://img.shields.io/twitter/follow/sparkfun.svg?style=social&logo=twitter"
19+
alt="follow on Twitter"></a>
20+
</p>
21+
22+
<table class="table table-hover table-striped table-bordered">
23+
<tr align="center">
24+
<td><a href="https://www.sparkfun.com/products/16396"><img src="https://cdn.sparkfun.com//assets/parts/1/1/9/2/5/14072-SparkFun_16x2_SerLCD_-_Black_on_RGB_3.3V-04.jpg" title="SparkFun SerLCD 16x2 - RGB Backlight (QWIIC)"></a></td>
25+
<td><a href="https://www.sparkfun.com/products/16397"><img src="https://cdn.sparkfun.com//assets/parts/1/1/9/2/5/14072-SparkFun_16x2_SerLCD_-_Black_on_RGB_3.3V-04.jpg" title="SparkFun SerLCD 16x2 - RGB Text (QWIIC)"></a></td>
26+
<td><a href="https://www.sparkfun.com/products/16398"><img src="https://cdn.sparkfun.com//assets/parts/1/1/9/2/5/14072-SparkFun_16x2_SerLCD_-_Black_on_RGB_3.3V-04.jpg" title="SparkFun SerLCD 20x2 - RGB Backlight (QWIIC)"></a></td>
27+
</tr>
28+
<tr align="center">
29+
<td><i><a href="https://www.sparkfun.com/products/16396">SparkFun SerLCD 16x2 - RGB Backlight (QWIIC)</a></i></td>
30+
<td><i><a href="https://www.sparkfun.com/products/16397">SparkFun SerLCD 16x2 - RGB Text (QWIIC)</a></i></td>
31+
<td><i><a href="https://www.sparkfun.com/products/16398">SparkFun SerLCD 20x2 - RGB Backlight (QWIIC)</a></i></td>
32+
</tr>
33+
</table>
34+
35+
Python module for I2C control of the SparkFun Qwiic Serial LCDs.
36+
37+
This package enables the user to access all of the features of these LCD products via a single Qwiic cable. This includes writing text to the screen, adjusting backlight levels (color), customizing splash screen and much much more. They come pre-programmed with the fully open-sourced [OpenLCD firmware](https://github.com/sparkfun/OpenLCD). All of the capabilities of these LCD screens are each demonstrated in the included 17 examples.
38+
39+
This package can be used in conjunction with the overall [SparkFun qwiic Python Package](https://github.com/sparkfun/Qwiic_Py)
40+
41+
New to qwiic? Take a look at the entire [SparkFun qwiic ecosystem](https://www.sparkfun.com/qwiic).
42+
43+
## Contents
44+
45+
* [Supported Platforms](#supported-platforms)
46+
* [Dependencies](#dependencies)
47+
* [Installation](#installation)
48+
* [Documentation](#documentation)
49+
* [Example Use](#example-use)
50+
51+
Supported Platforms
52+
--------------------
53+
The qwiic serlcd python package current supports the following platforms:
54+
* [Raspberry Pi](https://www.sparkfun.com/search/results?term=raspberry+pi)
55+
* [NVidia Jetson Nano](https://www.sparkfun.com/products/15297)
56+
* [Google Coral Development Board](https://www.sparkfun.com/products/15318)
57+
58+
Dependencies
59+
---------------
60+
This driver package depends on the qwiic I2C driver:
61+
[Qwiic_I2C_Py](https://github.com/sparkfun/Qwiic_I2C_Py)
62+
63+
Documentation
64+
-------------
65+
The SparkFun qwiic serlcd documentation is hosted at [ReadTheDocs](https://qwiic-serlcd-py.readthedocs.io/en/latest/)
66+
67+
Installation
68+
-------------
69+
70+
### PyPi Installation
71+
This repository is hosted on PyPi as the [sparkfun-qwiic-serlcd](https://pypi.org/project/sparkfun-qwiic-serlcd/) package. On systems that support PyPi installation via pip, this library is installed using the following commands
72+
73+
For all users (note: the user must have sudo privileges):
74+
```sh
75+
sudo pip install sparkfun-qwiic-serlcd
76+
```
77+
For the current user:
78+
79+
```sh
80+
pip install sparkfun-qwiic-serlcd
81+
```
82+
83+
### Local Installation
84+
To install, make sure the setuptools package is installed on the system.
85+
86+
Direct installation at the command line:
87+
```sh
88+
python setup.py install
89+
```
90+
91+
To build a package for use with pip:
92+
```sh
93+
python setup.py sdist
94+
```
95+
A package file is built and placed in a subdirectory called dist. This package file can be installed using pip.
96+
```sh
97+
cd dist
98+
pip install sparkfun_qwiic_serlcd-<version>.tar.gz
99+
100+
```
101+
Example Use
102+
---------------
103+
See the examples directory for more detailed use examples.
104+
105+
```python
106+
from __future__ import print_function
107+
import qwiic_serlcd
108+
import time
109+
import sys
110+
111+
def runExample():
112+
113+
print("\nSparkFun Qwiic SerLCD Example 1\n")
114+
myLCD = qwiic_serlcd.QwiicSerlcd()
115+
116+
if myLCD.connected == False:
117+
print("The Qwiic SerLCD device isn't connected to the system. Please check your connection", \
118+
file=sys.stderr)
119+
return
120+
121+
myLCD.setBacklight(255, 255, 255) # Set backlight to bright white
122+
myLCD.setContrast(5) # set contrast. Lower to 0 for higher contrast.
123+
myLCD.clearScreen() # clear the screen - this moves the cursor to the home position as well
124+
125+
time.sleep(1) # give a sec for system messages to complete
126+
127+
myLCD.print("Hello World!")
128+
counter = 0
129+
while True:
130+
print("counter: %d" % counter)
131+
myLCD.setCursor(0,1)
132+
myLCD.print(str(counter))
133+
counter = counter + 1
134+
time.sleep(1)
135+
136+
if __name__ == '__main__':
137+
try:
138+
runExample()
139+
except (KeyboardInterrupt, SystemExit) as exErr:
140+
print("\nEnding Example 1")
141+
sys.exit(0)
142+
```
143+
<p align="center">
144+
<img src="https://cdn.sparkfun.com/assets/custom_pages/3/3/4/dark-logo-red-flame.png" alt="SparkFun - Start Something">
145+
</p>

docs/_static/favicon.ico

894 Bytes
Binary file not shown.

docs/apiref.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
API Reference
2+
==============
3+
4+
.. automodule:: qwiic_dual_encoder_reader
5+
:members:

docs/conf.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# http://www.sphinx-doc.org/en/master/config
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
import os
14+
import sys
15+
sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'sparkfun_qwiic_dual_encoder_reader'
21+
copyright = '2020, SparkFun Electronics'
22+
author = 'SparkFun Electronics'
23+
24+
# The full version, including alpha/beta/rc tags
25+
release = '0.0.1'
26+
27+
28+
# -- General configuration ---------------------------------------------------
29+
30+
# Add any Sphinx extension module names here, as strings. They can be
31+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
32+
# ones.
33+
extensions = [
34+
'sphinx.ext.autodoc',
35+
'sphinx.ext.intersphinx',
36+
'sphinx.ext.viewcode',
37+
'm2r'
38+
]
39+
40+
source_suffix = ['.rst', '.md']
41+
# Add any paths that contain templates here, relative to this directory.
42+
templates_path = ['_templates']
43+
44+
master_doc = 'index'
45+
# List of patterns, relative to source directory, that match files and
46+
# directories to ignore when looking for source files.
47+
# This pattern also affects html_static_path and html_extra_path.
48+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
49+
50+
51+
# -- Options for HTML output -------------------------------------------------
52+
53+
# The theme to use for HTML and HTML Help pages. See the documentation for
54+
# a list of builtin themes.
55+
#
56+
import sphinx_rtd_theme
57+
html_theme = 'sphinx_rtd_theme'
58+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
59+
60+
# Add any paths that contain custom static files (such as style sheets) here,
61+
# relative to this directory. They are copied after the builtin static files,
62+
# so a file named "default.css" will overwrite the builtin "default.css".
63+
html_static_path = ['_static']
64+
65+
html_favicon = '_static/favicon.ico'
66+
67+
68+
69+

docs/ex1.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
Basic Operation
3+
---------------------------
4+
.. literalinclude:: ../examples/ex1_qwiic_dual_encoder_reader.py
5+
:caption: examples/ex1_qwiic_dual_encoder_reader.py
6+
:linenos:
7+

docs/ex2.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
Basic Operation
3+
---------------------------
4+
.. literalinclude:: ../examples/ex2_qwiic_dual_encoder_reader.py
5+
:caption: examples/ex2_qwiic_dual_encoder_reader.py
6+
:linenos:
7+

docs/index.rst

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
.. sparkfun_qwiic documentation master file, created by
2+
sphinx-quickstart on Tue Jul 2 11:01:40 2019.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
.. mdinclude:: ../README.md
7+
8+
Table of Contents
9+
=================
10+
11+
.. toctree::
12+
:maxdepth: 4
13+
:caption: Contents:
14+
15+
self
16+
17+
18+
.. toctree::
19+
:caption: API Reference
20+
:maxdepth: 3
21+
22+
apiref
23+
24+
.. toctree::
25+
:caption: Examples
26+
27+
ex1
28+
ex4
29+
ex5
30+
31+
.. toctree::
32+
:caption: Other Links
33+
34+
SparkFun <https://sparkfun.com>
35+
SparkFun Auto pHAT for Raspberry Pi <https://www.sparkfun.com/products/16328>
36+
GitHub <https://github.com/sparkfun/Qwiic_Dual_Encoder_Reader_Py>
37+
SparkFun qwiic <https://www.sparkfun.com/qwiic>
38+
39+
40+
Indices and tables
41+
==================
42+
43+
* :ref:`genindex`
44+
* :ref:`modindex`
45+
* :ref:`search`

0 commit comments

Comments
 (0)