Skip to content

Commit cd3839e

Browse files
committed
Add SPI usage to README.
1 parent 9e3b327 commit cd3839e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Introduction
66

77
`pyduino-includes` is a SNAPpy library that is designed to make development for the Synapse Pyduino board easier. It
88
allows references to the nifty Pyduino IO names (like D3, AD0, or SCL) instead of the underlying SNAPpy GPIO numbers.
9+
It also provides a bit-banged SPI implementation that can be used for shields that utilize the SPI pins.
910

1011
Installation
1112
------------
@@ -42,3 +43,13 @@ Pins can be referenced as follows:
4243
| Analog | A0 - A5 |
4344
| i2c | SDA, SCL |
4445

46+
Setting up the SPI pins is very simple, too:
47+
48+
```python
49+
from PyduinoIncludes.SPI import *
50+
51+
def my_spi_function():
52+
spi_init() # Sets up the bit-banged SPI
53+
spi_write("\x12\x34\x56") # Write data to the SPI bus
54+
spi_read(4) # Read four bytes from the SPI bus
55+
```

0 commit comments

Comments
 (0)