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/)

Files at this revision

API Documentation at this revision

Comitter:
hajesusrodrigues
Date:
Thu May 30 22:11:56 2013 +0000
Parent:
0:9457949d5d00
Child:
2:23bc34ad7aa5
Commit message:
Code Format

Changed in this revision

RFM12B.lib Show annotated file Show diff for this revision Revisions of this file
TextLCD.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/RFM12B.lib	Thu May 30 22:10:28 2013 +0000
+++ b/RFM12B.lib	Thu May 30 22:11:56 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/pangsk/code/RF12B/#52322349ee10
+http://mbed.org/users/pangsk/code/RF12B/#19d9da22271a
--- a/TextLCD.lib	Thu May 30 22:10:28 2013 +0000
+++ b/TextLCD.lib	Thu May 30 22:11:56 2013 +0000
@@ -1,1 +1,1 @@
-TextLCD#4c1e9254e104
+TextLCD#cce166e6d577
--- a/main.cpp	Thu May 30 22:10:28 2013 +0000
+++ b/main.cpp	Thu May 30 22:11:56 2013 +0000
@@ -37,7 +37,8 @@
 
 #define TEST_TYPE MBED_TO_MBED
 
-void ReceiverThread(void const *args) {
+void ReceiverThread(void const *args)
+{
     Timer receiverTimer;
     rfm12b_receiver.Initialize(SERVER_MBED_NODE, RF12_433MHZ, NETWORD_ID); //id = 10, band 433, group 5
     rfm12b_receiver.SetEncryptionKey((uint8_t*) KEY);
@@ -84,7 +85,8 @@
     }
 }
 
-void SenderThread(void const *args) {
+void SenderThread(void const *args)
+{
     Timer ackTimer;
     Timer senderTimer;
 
@@ -149,7 +151,8 @@
     }
 }
 
-int main() {
+int main()
+{
 
 #if TEST_TYPE == MBED_TO_MBED
 
@@ -181,7 +184,7 @@
         activity_ledOn = 0;
         activity_ledOff = 1;
         wait(0.2);
-        
+
         if(pc.readable()) {
             if (pc.getc() == 'r') {
                 mbed_reset();