ECE 4180 - Final Project Team / Mbed 2 deprecated WalkieTalkie

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

Revision:
22:e835b3490280
Parent:
21:95009b231c1f
Child:
23:3504e0899359
Child:
25:02cdaf98e4ab
--- a/main.cpp	Sat Apr 21 16:47:02 2018 +0000
+++ b/main.cpp	Sat Apr 21 16:54:34 2018 +0000
@@ -119,6 +119,7 @@
 {
     uint8_t spkrarray[29];
     while (Button == 0) {
+        mode = RECEIVE;
         if (my_nrf24l01p.readable(0)) {
             rxbuff.push(spkrarray, 30);
             spkr.write(spkrarray[1]);
@@ -134,6 +135,7 @@
     // txData[txDataCnt++] = ;
     spkr.turnOff();
     while (Button == 1) {
+        mode = TRANSMIT;
         my_nrf24l01p.write(0, (char *)micvalue, 30);
     }
 }
@@ -188,6 +190,8 @@
     my_nrf24l01p.setReceiveMode();
     my_nrf24l01p.enable();
     
+    mode = RECEIVE;
+    
     // Initialize the uLCD
     uLCD.baudrate(3000000);
     uLCD.background_color(BLACK);