Skip to content

Commit 1bc6cae

Browse files
authored
Merge pull request #5 from brentru/add-led-to-examples
Add LED to Examples, update README
2 parents d5411fb + 1f12f0c commit 1bc6cae

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

README.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,31 @@ Please ensure all dependencies are available on the CircuitPython filesystem.
2626
This is easily achieved by downloading
2727
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.
2828

29+
Installing from PyPI
30+
--------------------
31+
32+
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
33+
PyPI <https://pypi.org/project/adafruit-circuitpython-tinylora/>`_. To install for current user:
34+
35+
.. code-block:: shell
36+
37+
pip3 install adafruit-circuitpython-tinylora
38+
39+
To install system-wide (this may be required in some cases):
40+
41+
.. code-block:: shell
42+
43+
sudo pip3 install adafruit-circuitpython-tinylora
44+
45+
To install in a virtual environment in your current project:
46+
47+
.. code-block:: shell
48+
49+
mkdir project-name && cd project-name
50+
python3 -m venv .env
51+
source .env/bin/activate
52+
pip3 install adafruit-circuitpython-tinylora
53+
2954
Usage Example
3055
=============
3156

@@ -87,3 +112,11 @@ Now, once you have the virtual environment activated:
87112
This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to
88113
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
89114
locally verify it will pass.
115+
116+
License
117+
=======
118+
This library was written by ClemensRiederer. We've converted it to work with Adafruit CircuitPython and made
119+
changes so it works with the Raspberry Pi and Adafruit Feather M0/M4. We've added examples for using this library
120+
to transmit data and sensor data to The Things Network.
121+
122+
This open source code is licensed under the LGPL license (see LICENSE for details).

examples/tinylora_simpletest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
import board
55
from adafruit_tinylora.adafruit_tinylora import TTN, TinyLoRa
66

7+
# Board LED
8+
led = digitalio.DigitalInOut(board.D13)
9+
led.direction = digitalio.Direction.OUTPUT
10+
711
spi = busio.SPI(board.SCK, MISO=board.MISO, MOSI=board.MOSI)
812

913
# RFM9x Breakout Pinouts
@@ -34,5 +38,7 @@
3438
print('Sending packet...')
3539
lora.send_data(data, len(data), lora.frame_counter)
3640
print('Packet sent!')
41+
led.value = True
3742
lora.frame_counter += 1
3843
time.sleep(1)
44+
led.value = False

examples/tinylora_simpletest_si7021.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
import adafruit_si7021
88
from adafruit_tinylora.adafruit_tinylora import TTN, TinyLoRa
99

10+
# Board LED
11+
led = digitalio.DigitalInOut(board.D13)
12+
led.direction = digitalio.Direction.OUTPUT
1013

1114
# Create library object using our bus i2c port for si7021
1215
i2c = busio.I2C(board.SCL, board.SDA)
@@ -61,5 +64,7 @@
6164
print('Sending packet...')
6265
lora.send_data(data, len(data), lora.frame_counter)
6366
print('Packet Sent!')
67+
led.value = True
6468
lora.frame_counter += 1
6569
time.sleep(2)
70+
led.value = False

0 commit comments

Comments
 (0)