Pratik Sheth / Mbed 2 deprecated kl25Z_nRF_TX

Dependencies:   mbed nRF24L01P

Files at this revision

API Documentation at this revision

Comitter:
pratik_sheth_
Date:
Wed Jan 23 17:16:35 2019 +0000
Parent:
0:19a03658bf70
Commit message:
Implemented a sensor node that could sense data from any connected sensor and transmit it over an Ethernet interface to a thingspeak.com; ;

Changed in this revision

Transmitter.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 19a03658bf70 -r 13a4d3f1a576 Transmitter.cpp
--- a/Transmitter.cpp	Mon Jun 01 05:20:18 2015 +0000
+++ b/Transmitter.cpp	Wed Jan 23 17:16:35 2019 +0000
@@ -8,13 +8,13 @@
 
 int main()
 {
-    char count[2];
+    char count[2]; // array of 2 elements
     char TxDataCnt;
     char temp;
 
 
-    my_nrf24l01p.powerUp();
-    my_nrf24l01p.setRfFrequency(2410);
+    my_nrf24l01p.powerUp(); //power up devices
+    my_nrf24l01p.setRfFrequency(2450); // set frequency
 
     // Display the (default) setup of the nRF24L01+ chip
     pc.printf( "nRF24L01+ Frequency    : %d MHz\r\n",  my_nrf24l01p.getRfFrequency() );
@@ -25,10 +25,10 @@
 
     pc.printf( "Simple Transmitter (0 - 9 Counter) \r\n");
 
-    TxDataCnt = 2;
-    my_nrf24l01p.setTransferSize(TxDataCnt);
+    TxDataCnt = 2; //transmits packets when we have 2 bytes
+    my_nrf24l01p.setTransferSize(TxDataCnt); // transmitter buffer there is a utility to check the value
 
-    my_nrf24l01p.enable();
+    my_nrf24l01p.enable(); //enables transmission mode
 
     count[0] = 0x01;
     count[1] = 0x01;
@@ -36,9 +36,9 @@
     while (1) {
 
         // Send the Transmit buffer via the nRF24L01+
-        temp = my_nrf24l01p.write( NRF24L01P_PIPE_P0,count, TxDataCnt );
+        temp = my_nrf24l01p.write( NRF24L01P_PIPE_P0,count, TxDataCnt );//write something on transmission buffer count=array we copy only 2 bytes
 
-        pc.printf( "Sending %d - %d %d\r\n",temp,count[0],count[1]);
+        pc.printf( "Sending %d - %d %d\r\n",temp,count[0],count[1]); //count0 n count 1 are printed on my terminal
 
         // Toggle LED1 (to help debug Host -> nRF24L01+ communication)
         RedLED = !RedLED;