etrombly / RFM69

Python RFM69 library for raspberrypi
GNU General Public License v3.0
115 stars 77 forks source link

How to change Chip Select/NSS #43

Open joejackson3 opened 3 years ago

joejackson3 commented 3 years ago

Hello, I'm trying to connect an RFM69 to a Raspberry Zero. It already is connected to an ePaper Hat, which uses the same SPI pins. I appreciate that the Interrupt pin can be changed "You can change the interrupt pin (GPIO24) in the class init." but how can I change the Chip Select (NSS/CE) pin to make these two SPI modules work? Thank you.

etrombly commented 3 years ago

The chip select is the same as device in the rfm69 init:

class RFM69(object):
    def __init__(self, freqBand, nodeID, networkID, isRFM69HW = False, intPin = 18, rstPin = 29, spiBus = 0, spiDevice = 0):

so set spiDevice to the CE you would like to use. Here's an example pinout https://pinout.xyz/pinout/spi you can set device to 0 or 1 which would be pins 24 or 26.

joejackson3 commented 3 years ago

Thank you very much for the suggestion. Will try this soon.