File tree Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,28 @@ Usage Example
31
31
32
32
.. code-block :: python
33
33
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 ()
35
56
36
57
Contributing
37
58
============
Original file line number Diff line number Diff line change @@ -23,14 +23,10 @@ Table of Contents
23
23
.. toctree ::
24
24
:caption: Tutorials
25
25
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
-
29
26
.. toctree ::
30
27
:caption: Related Products
31
28
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)
34
30
35
31
.. toctree ::
36
32
:caption: Other Links
You can’t perform that action at this time.
0 commit comments