ECE 4180 - Final Project Team / Mbed 2 deprecated WalkieTalkie

Dependencies:   mbed 4DGL-uLCD-SE mbed-rtos nRF24L01P

Revision:
31:39d04aedc3e5
Parent:
30:1c309c020125
Child:
32:c40d581f50af
--- a/main.cpp	Mon Apr 23 15:04:28 2018 +0000
+++ b/main.cpp	Mon Apr 23 15:29:18 2018 +0000
@@ -140,7 +140,9 @@
             }
         }
         
+        pc.printf("%d %d\n\r", txbuff.size(), rxbuff.size());
         Thread::yield();
+        Thread::wait(100);
     }
 }
 
@@ -194,28 +196,6 @@
     
     mode = RECEIVE;
     
-    CircularBuf<int> temp(20);
-    int t[1];
-    for (int i = 0; i < 5; i++) {
-        t[0] = i;
-        pc.printf("%d.", temp.push(&t[0], 1));
-    }
-    pc.printf("\n\rBuff size %d\n\r", temp.size());
-    
-    for (int i = 0; i < 20; i++) {
-        pc.printf("%d ", temp._data[i]);
-    }
-    pc.printf("\n\r%d %d\n\r", temp._head, temp._tail);
-    
-    for (int i = 0; i < 5; i++) {
-        t[0] = 0;
-        pc.printf("%d.", temp.pop(&t[0], 1));
-        pc.printf("%d ",  t);
-        pc.printf("\n\r%d %d\n\r", temp._head, temp._tail);
-    }
-    pc.printf("\n\rBuff size %d\n\r", temp.size());
-    pc.printf("\n\r%d %d\n\r", temp._head, temp._tail);
-    
     // Initialize the uLCD
     //uLCD.baudrate(3000000);
     //uLCD.background_color(BLACK);
@@ -227,11 +207,11 @@
     // Setup the button to enter transmit mode when pushed down
     // and recieve when release
     button.mode(PullUp);
-    //button.fall(&enterTransmitMode);
-    //button.rise(&enterRecieveMode);
+    button.fall(&enterTransmitMode);
+    button.rise(&enterRecieveMode);
     
     // Setup sampler to sample at a specific frequency
-    //sampler.attach(&sampleData, SAMPLE_PERIOD);
+    sampler.attach(&sampleData, SAMPLE_PERIOD);
     
     pc.printf("Enter Heartbeat\n\r");
     // Heartbeat thread