Skip to content

Commit a864e8d

Browse files
author
Kevin Townsend
committed
More Travis appeasement
1 parent a4a8980 commit a864e8d

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

README.rst

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,28 @@ Usage Example
3131

3232
.. code-block:: python
3333
34-
TODO
34+
import busio
35+
import digitalio
36+
import board
37+
38+
from adafruit_bluefruitspi import BluefruitSPI, MsgType
39+
40+
spi_bus = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
41+
cs = digitalio.DigitalInOut(board.A5)
42+
irq = digitalio.DigitalInOut(board.A4)
43+
bluefruit = BluefruitSPI(spi_bus, cs, irq, debug=True)
44+
45+
# Send the ATI command
46+
try:
47+
msgtype, msgid, rsp = bluefruit.cmd("ATI\n")
48+
if msgtype == MsgType.ERROR:
49+
print("Error (id:{0})".format(hex(msgid)))
50+
if msgtype == MsgType.RESPONSE:
51+
print("Response:")
52+
print(rsp)
53+
except RuntimeError as error:
54+
print("AT command failure: " + repr(error))
55+
exit()
3556
3657
Contributing
3758
============

docs/index.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,10 @@ Table of Contents
2323
.. toctree::
2424
:caption: Tutorials
2525

26-
.. todo:: Add any Learn guide links here. If there are none, then simply delete this todo and leave
27-
the toctree above for use later.
28-
2926
.. toctree::
3027
:caption: Related Products
3128

32-
.. todo:: Add any product links here. If there are none, then simply delete this todo and leave
33-
the toctree above for use later.
29+
Bluefruit LE SPI Friend <https://www.adafruit.com/product/2633)
3430

3531
.. toctree::
3632
:caption: Other Links

0 commit comments

Comments
 (0)