Skip to content

JF002/cfRFM69

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cfRFM69

RFM69 driver library for ESP32/Arduino designed to run on ESP32 but should work on any board supported by the Arduino framework with an SPI bus.

RFM69 is an RF transceiver (433/868Mhz) that can be driver by the SPI bus.

I wrote this library for one of my project, when I was trying to make my doorbell ring, and detect the push button. There are many existing library, but none specifically written for the ESP32, so I wrote mine (because I can :) ).

How to use it

#include <Arduino.h>
#include <RFM69.h>
#include <SPI.h>
#include <memory>

using namespace Codingfield::Communication;

SPIClass spi(HSPI);
std::unique_ptr<Codingfield::Communication::RFM69> radio;

void setup() {
  spi.begin();
  radio.reset(new RFM69(&spi, 15));
  if(radio->IsRfm69()) {
      auto temperature = radio->ReadTemperature();
      Serial.println("Temperature : " + String(temperature));

      radio->SetOperatingMode(RFM69::Modes::Standby);
      radio->SetDataModulation(RFM69::ModulationShapings::NoShaping,
                             RFM69::ModulationTypes::FSK,
                             RFM69::DataModes::Packet);
      radio->SetBitRate(0x1430); // 6.250 kpbs
      radio->SetFrequencyDeviation(0x0333); // 50Khz
      radio->SetFrequency(0x00D913E8); // 868Mhz
      
      // ...
  }
}  

Examples

The project contains a simple basic TX example (the only use-case I've tested for now). I'll try to do more projects when I have the time :)

See also my doorbell project for a full real-world example.

Links