Skip to content

Updated examples to set CS on D20 #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/example1_basic_lightning_spi.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@
# Create a library object using the Bus SPI port
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)

# Set up chip select (CE0 is labeled CS on Sparkfun Pi Hat)
cs = digitalio.DigitalInOut(board.CE0)
# Set up chip select on D20
# CS can be any available GPIO pin
cs = digitalio.DigitalInOut(board.D20)
cs.direction = digitalio.Direction.OUTPUT

lightning = sparkfun_qwiicas3935.Sparkfun_QwiicAS3935_SPI(spi, cs)
Expand Down
5 changes: 3 additions & 2 deletions examples/example2_more_lightning_features_spi.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@
# Create a library object using the Bus SPI port
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)

# Set up chip select (CE0 is labeled CS on Sparkfun Pi Hat)
cs = digitalio.DigitalInOut(board.CE0)
# Set up chip select on D20
# CS can be any available GPIO pin
cs = digitalio.DigitalInOut(board.D20)
cs.direction = digitalio.Direction.OUTPUT

lightning = sparkfun_qwiicas3935.Sparkfun_QwiicAS3935_SPI(spi, cs)
Expand Down
5 changes: 3 additions & 2 deletions examples/example3_tune_antenna_spi.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
# Create a library object using the Bus SPI port
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)

# Set up chip select (CE0 is labeled CS on Sparkfun Pi Hat)
cs = digitalio.DigitalInOut(board.CE0)
# Set up chip select on D20
# CS can be any available GPIO pin
cs = digitalio.DigitalInOut(board.D20)
cs.direction = digitalio.Direction.OUTPUT

lightning = sparkfun_qwiicas3935.Sparkfun_QwiicAS3935_SPI(spi, cs)
Expand Down
8 changes: 7 additions & 1 deletion examples/qwiicas3935_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
that status of the Qwiic AS3935 Lightning Detector.
"""
import sys

# import busio
# import digitalio
import board
import sparkfun_qwiicas3935

Expand All @@ -27,8 +30,11 @@
lightning = sparkfun_qwiicas3935.Sparkfun_QwiicAS3935_I2C(i2c)

# OR create a library object using the Bus SPI port
# CS can be any available GPIO pin

# spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
# cs = digitalio.DigitalInOut(board.D8)
# cs = digitalio.DigitalInOut(board.D20)
# cs.direction = digitalio.Direction.OUTPUT
# lightning = sparkfun_qwiicas3935.Sparkfun_QwiicAS3935_SPI(spi, cs)

# Check if connected
Expand Down