RobOmega - PSL RoboCup / Mbed 2 deprecated nRF24L01P_SerialToBoard_L475VG

Dependencies:   mbed nRF24L01P

Files at this revision

API Documentation at this revision

Comitter:
louisroyer
Date:
Fri Dec 11 09:30:05 2020 +0000
Parent:
8:05427ba764a9
Commit message:
;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Dec 11 09:07:00 2020 +0000
+++ b/main.cpp	Fri Dec 11 09:30:05 2020 +0000
@@ -59,9 +59,7 @@
     my_nrf24l01p.enable();
     
     
-    char* data = "Hello PC !\r\n";
-    int dataSize = strlen(data) + 1;
-    int i = 0;
+ 
 
     while (1) 
     {
@@ -69,8 +67,9 @@
         if ( pc.readable() ) {
 
             // ...add it to the transmit buffer
+            
             txData[txDataCnt++] = pc.getc();
-
+            pc.putc(txData[txDataCnt]);
         
         
             // If the transmit buffer is full
@@ -80,9 +79,10 @@
                 my_nrf24l01p.write( NRF24L01P_PIPE_P0, txData, txDataCnt );
     
                 txDataCnt = 0;
+                myled1 = !myled1;
             }
     }
         // Toggle LED1 (to help debug Host -> nRF24L01+ communication)
-        myled1 = !myled1;
+       
     }
 }