rf12_initialize()
Initialize the RFM12 / RFM12B wireless module for reception and transmission.
#include <RF12.h>
#include <Ports.h> // needed to avoid a linker error :(
byte rf12_initialize(byte nodeId, byte freqBand, byte netGroup =212);
Returns the nodeId, to be compatible with rf12_config().
Parameters
nodeId
The ID of this wireless node. ID's should be unique within the netGroup in which this node is operating. The range for ID's is 0 to 31, but only 1..30 are available for normal use. You can pass a single capital letter as node ID, with 'A' .. 'Z' corresponding to the node ID's 1..26, but this convention is now discouraged. ID 0 is reserved for OOK use, node ID 31 is special because it will pick up packets for any node (in the same netGroup).
freqBand
This determines in which frequency range the wireless module will operate. The following pre-defined constants are available: RF12_433MHZ, RF12_868MHZ, RF12_915MHZ. You should use the one matching the module you have.
netGroup
Net groups are used to separate nodes: only nodes in the same net group can communicate with each other. Valid values are from 1 to 212. This parameter is optional, it defaults to 212 (0xD4) when omitted. This is the only allowed value for RFM12 modules, only RFM12B modules support other group values.
Programming Tips
Note that rf12_initialize() does not use the EEprom netId and netGroup settings, nor does it change the EEPROM settings. To use the netId and netGroup settings saved in EEPROM use rf12_config() instead of rf12_initialize. The choice whether to use rf12_initialize() or rf12_config() at the top of every sketch is one of personal preference. To set EEPROM settings for use with rf12_config() use the RF12demo sketch.