Library to send and receive data using RF12B transceiver modules Big thanks to the tutorial at https://loee.jottit.com/rfm12b_and_avr_-_quick_start and madcowswe
Dependents: Measure_system Quadcopter_copy
Diff: RF12B.h
- Revision:
- 8:6fc24b44e027
- Parent:
- 7:9f9e2a63a8a2
--- a/RF12B.h Fri Mar 11 19:30:30 2011 +0000 +++ b/RF12B.h Fri Mar 11 20:40:43 2011 +0000 @@ -4,8 +4,6 @@ #include "mbed.h" #include <queue> -#define PACKET_LEN 16 - enum rfmode_t{RX, TX}; class RF12B { @@ -28,9 +26,8 @@ /* Transmits a packet of data */ void write(unsigned char* data, unsigned char length); - - /* Transmits a 1-byte packet of data */ - void write(unsigned char data); + void write(unsigned char data); /* 1-byte packet */ + void write(queue<char> &data, int length = -1); /* sends a whole queue */ /* Returns the packet length if data is available in the receive buffer, 0 otherwise*/ unsigned int available(); @@ -47,6 +44,8 @@ InterruptIn NIRQ; DigitalIn NIRQ_in; DigitalOut rfled; + + rfmode_t mode; /* Initialises the RF12B module */ void init();