RFM12B Example

Dependencies:   RFM12B TextLCD mbed-rtos mbed

/media/uploads/hajesusrodrigues/img_3299.jpg

mBed RFM12B module Hello World example

The main purpose of this example was to implement the RFM12B module in order to be able to establish communication with the Moteino (arduino clone that uses the RFM12B).

In this example I’m able to test the communication between:

1) mBed -> mBed (2 RFM12B modules sharing the same mBed board)

2) mBed -> Moteino

3) Moteino -> mBed

Who/What is Moteino? (http://lowpowerlab.com/moteino/)

Revision:
4:03f3bdc02069
Parent:
1:e30050868e55
Child:
6:a16fea75abd3
--- a/main.cpp	Thu May 30 22:40:30 2013 +0000
+++ b/main.cpp	Thu May 30 22:45:06 2013 +0000
@@ -1,11 +1,11 @@
 #include "mbed.h"
 #include "rtos.h"
 #include "RFM12B/RFM12B.h"
-#include "TextLCD/TextLCD.h"
+//#include "TextLCD/TextLCD.h"
 
 extern "C" void mbed_reset();
 
-TextLCD lcd(p22, p23, p24, p25, p26, p27, p28,TextLCD::LCD16x2); // rs, rw, e, d4-d7
+//TextLCD lcd(p22, p23, p24, p25, p26, p27, p28,TextLCD::LCD16x2); // rs, rw, e, d4-d7
 
 RFM12B rfm12b_sender(p5, p6, p7, p10, p9, LED1); //RFM12B(PinName SDI, PinName SDO, PinName SCK, PinName SEL, PinName IRQ, , PinName IRQ_LED);
 RFM12B rfm12b_receiver(p11, p12, p13, p14, p15, LED4); //RFM12B(PinName SDI, PinName SDO, PinName SCK, PinName SEL, PinName IRQ, , PinName IRQ_LED);
@@ -51,8 +51,8 @@
 
             receiverTimer.start();
             printf("RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\nRECEIVER- beginning receiving message\n");
-            lcd.locate(0,1);
-            lcd.printf("RECEIVER- BRM");
+            //lcd.locate(0,1);
+            //lcd.printf("RECEIVER- BRM");
 
             if (rfm12b_receiver.CRC_Pass()) {
 
@@ -72,8 +72,8 @@
             }
 
             printf("RECEIVER- finishing receiving message (time since start receiving message %d ms, %4.2f s)\nRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\n", receiverTimer.read_ms(), receiverTimer.read());
-            lcd.locate(0,1);
-            lcd.printf("RECEIVER- finishing receiving message");
+            //lcd.locate(0,1);
+            //lcd.printf("RECEIVER- finishing receiving message");
 
             receiverTimer.stop();
             receiverTimer.reset();