Skip to content

Commit 73ca93f

Browse files
committed
add very simple example
1 parent 866fe40 commit 73ca93f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

README.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Introduction
1313
:target: https://travis-ci.org/adafruit/Adafruit_CircuitPython_miniQR
1414
:alt: Build Status
1515

16-
.. todo:: Describe what the library does.
16+
A non-hardware dependant miniature QR generator library. All native Python!
1717

1818
Dependencies
1919
=============
@@ -28,7 +28,13 @@ This is easily achieved by downloading
2828
Usage Example
2929
=============
3030

31-
See examples folder for QR generating and displaying/drawing
31+
.. code-block:: python
32+
import adafruit_miniqr
33+
34+
qr = adafruit_miniqr.QRCode()
35+
qr.add_data(b'https://www.adafruit.com')
36+
qr.make()
37+
print(qr.matrix)
3238
3339
Contributing
3440
============

examples/miniqr_simpletest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
WHITE = "\x1b[1;47m \x1b[40m"
77
BLACK = " "
88

9-
def print_QR(matrix):
9+
def prettyprint_QR(matrix):
1010
# white 4-pixel border at top
1111
for _ in range(4):
1212
for _ in range(matrix.width+8):
@@ -30,4 +30,5 @@ def print_QR(matrix):
3030
qr = adafruit_miniqr.QRCode(qr_type=3, error_correct=adafruit_miniqr.L)
3131
qr.add_data(b'https://www.adafruit.com')
3232
qr.make()
33-
print_QR(qr.matrix)
33+
print(qr.matrix)
34+
prettyprint_QR(qr.matrix)

0 commit comments

Comments
 (0)