Wireless sensor network co-ordinator.

Dependencies:   mbed nRF24L01P

Fork of WSN_Coordinator by Janhavi Kulkarni

Revision:
5:2f12cc3b6acb
Parent:
4:b3a70cbb7c81
--- a/Receiver.cpp	Mon Jun 06 10:57:33 2016 +0000
+++ b/Receiver.cpp	Tue Jun 07 06:11:45 2016 +0000
@@ -16,6 +16,7 @@
     char count[1];
     char RxDataCnt_PIPE0, RxDataCnt_PIPE1;
     char temp;
+    char pot1Val, pot2Val;
     
     //specifying address same as transmitter for pipe0 and pipe1
     long long RxAddress_PIPE1 = 0xE2E2E2E2E2;
@@ -57,12 +58,13 @@
  
             // ...read the data into the receive buffer
             temp = my_nrf24l01p.read( NRF24L01P_PIPE_P0, count, RxDataCnt_PIPE0 );
+            
+            pot1Val = count[0];
  
-            pc.printf("Received: %d bytes from PIPE0; POT=%d\r\n",temp, count[0]);
+            //pc.printf("Received: %d bytes from PIPE0; POT=%d\r\n",temp, count[0]);
             
             // Toggle LED2 (to help debug nRF24L01+ -> Host communication)
             GreenLED = !GreenLED;
-            wait_ms(10);
         }
         
         //check if data is there in pipe1
@@ -70,12 +72,15 @@
  
             // ...read the data into the receive buffer
             temp = my_nrf24l01p.read( NRF24L01P_PIPE_P1, count, RxDataCnt_PIPE1 );
+            
+            pot2Val = count[0];
  
-            pc.printf("Received: %d bytes from PIPE1; POT=%d\r\n",temp, count[0]);
+            //pc.printf("Received: %d bytes from PIPE1; POT=%d\r\n",temp, count[0]);
             
             // Toggle LED2 (to help debug nRF24L01+ -> Host communication)
             BlueLED = !BlueLED;
-            wait_ms(10);
         }
+        wait_ms(100);
+        pc.printf("$%d %d;", pot1Val, pot2Val);
     }
 }
\ No newline at end of file