Datasheet
However if you're using the Feather M0 RFM69 board with a built-in RFM69 radio (and you've loaded the special
version of CircuitPython just for this board as mentioned above), you instead want to use these pins for the CS and RST
lines:
You're ready to import the RFM69 module and create an instance of the RFM69 class inside it. Before you create the
radio module instance you'll need to check if you're using a 433mhz or 915mhz radio module as the initializer requires
the frequency to be specified--confirm which frequency your module uses and run one of the following lines.
For a 915mhz radio use:
Or for a 433mhz radio use:
Notice the initializer takes the following required parameters:
spi - The SPI bus connected to the board.
cs - The DigitalInOut instance connected to the CS line of the radio.
reset - The DigitalInOut instance connected to the RST or reset line of the radio.
frequency - The frequency in megahertz of the radio module. Remember this frequency depends on which type
of radio you're using and the frequency you desire to use!
In addition there are some optional parameters you might specify:
baudrate - The baud rate to use for the SPI connection to the radio. By default this is 10mhz which is as fast as
the radio can handle, but in some cases it might be too fast if you're wiring up a breakout to a breadboard
(breadboards can be notorious for not working well with high speed signals). If you run into odd errors like being
unable to find the RFM69 radio try lowering the baudrate by specifying a baudrate=1000000 keyword (which
sets the speed to a lower 1mhz value).
Once the RFM69 class is created and initialized you're ready to start sending and receiving data.
Remember by default the module will be configured to interface with the "RadioHead" RFM69 setup so you can also
send and receive packets with an Arduino running the 'raw' TX/RX examples!
To send a message simply call the send function and provide a string or byte string of data:
Remember you can only send a message up to 60 bytes in length at a time! Attempting to send a message longer
than 60 bytes will fail with an exception error. If you need to send a longer message it will have to be broken up into
multiple send calls and reconstructed on the receiving side.
cs = digitalio.DigitalInOut(board.RFM69_CS)
reset = digitalio.DigitalInOut(board.RFM69_RST)
import adafruit_rfm69
rfm69 = adafruit_rfm69.RFM69(spi, cs, reset, 915.0)
import adafruit_rfm69
rfm69 = adafruit_rfm69.RFM69(spi, cs, reset, 433.0)
rfm69.send('Hello world!')
© Adafruit Industries
https://learn.adafruit.com/adafruit-rfm69hcw-and-rfm96-rfm95-rfm98-lora-packet-padio-
breakouts
Page 43 of 70