RF24G  0.9
Simple Abstraction Layer for the nRF24L01
List of all members
RF24_G Class Reference

Public Member Functions

Primary public interface

These are the main methods you need to send and receive data.

 RF24_G ()
 
 RF24_G (uint8_t address, uint8_t _cepin, uint8_t _cspin)
 
bool available ()
 
bool write (const packet *_packet)
 
bool read (packet *_packet)
 
bool setChannel (uint8_t channel)
 

Constructor & Destructor Documentation

§ RF24_G() [1/2]

RF24_G::RF24_G ( )

Default Constructor

Creates a new instance of the radio object. This configures tmrh20's driver to default settings. Use this if you want to instantiate the radio class, but initialize it later.

§ RF24_G() [2/2]

RF24_G::RF24_G ( uint8_t  address,
uint8_t  _cepin,
uint8_t  _cspin 
)

Constructor

Creates a new instance of the radio object. This configures tmrh20's driver. Before using, you create an instance and send in the unique pins that this chip is connected to.

Parameters
addressThe address of tis radio instance
_cepinThe pin attached to Chip Enable on the RF module
_cspinThe pin attached to Chip Select

Member Function Documentation

§ available()

bool RF24_G::available ( )

Checks if there is a packet received packet to be read

Returns
True if a packet is available, false if not.

§ write()

bool RF24_G::write ( const packet _packet)

Writes a packet. This needs the address of an object and it's size to work correctly.

//write() example:
int var;
if (radio.write( &packet) == false) {
Serial.println("Transmission failed!")
}
Returns
True if a packet was sent successfully, false if not.

§ read()

bool RF24_G::read ( packet _packet)

Reads a packet. This needs the address of an object to work correctly.

//read() example:
int var;
if (radio.read( &packet) == false) {
Serial.println("Receive failed!")
}
Returns
True if a packet was read successfully, false if not.

§ setChannel()

bool RF24_G::setChannel ( uint8_t  channel)

Sets the channel to use

Note
The available channels are 0-125, but channels 108+ are out of the wifi band and recommended.
Returns
True if the channel was set successfully, false if not.

The documentation for this class was generated from the following files: