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: RFSerial.cpp
- Revision:
- 6:98da0571ec31
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RFSerial.cpp Fri Mar 11 15:47:06 2011 +0000 @@ -0,0 +1,25 @@ + +/* Constructor */ +#include "RFSerial.h" + +RFSerial::RFSerial(PinName _SDI, + PinName _SDO, + PinName _SCK, + PinName _NCS, + PinName _NIRQ) +:RF12B(_SDI, _SDO, _SCK, _NCS, _NIRQ) { + +} + +// Stream implementation functions +int RFSerial::_putc(int value) { + RF12B::write((unsigned char) value); + return value; +} +int RFSerial::_getc() { + if(available()) { + return RF12B::read(); + } else { + return EOF; + } +} \ No newline at end of file