This is a library for the rfm12b(or rf12b they also mix up the name) radio module from hoperf (http://www.hoperf.com) It implements a easy to use Arduino style interface to the radio chip. The goal is to allow Arduino's to easily communicate with each other.
for examples see the examples directory
For documentation check the wiki https://github.com/bazingalabs/RF12B/wiki
To install this library follow the steps below
- Go to your arduino libraries directory
- Clone the repository
git clone [email protected]:bazingalabs/RF12B.git
- Restart Arduino IDE if it was running
- The library should now be listed in the menu Sketch -> Import library and Examples under File -> Examples
First include the rf12B, rf_packet and SPI library
#include <SPI.h>
#include <RF12B.h>
#include <rf_packet.h>
In setup initialize the library by calling begin optionally set things like frequency etc.
void setup() {
Serial.begin(57600);
RF12.begin();
}
Now send a packet by calling sendPacket
RFPacket packet("hello", 5, 1, 1,2);
RF12.send(packet, packet.size());
And receive with
if (RF12.packetAvailable()) {
RFPacket p = RF12.recvPacket();
// Only print valid packets
if (p.valid()) {
Serial.println("Received:");
Serial.print(p);
}
}
This is a libray for the Roger board from Bazingalabs (http://www.bazingalabs.com)
The code is based on the rf12 tutorial from https://loee.jottit.com/rfm12b_and_avr_-_quick_start