현성 김 / Mbed 2 deprecated 181202_Castone_design_master

Dependencies:   mbed nRF24L01P

Revision:
2:4d2d1b988c14
Parent:
1:450bd5ee8cdc
Child:
3:690740ab3394
--- a/main.cpp	Sat Nov 03 13:58:06 2018 +0000
+++ b/main.cpp	Sat Nov 03 14:06:28 2018 +0000
@@ -23,11 +23,11 @@
 //uint8_t rxAddr[10][6] = {"BOT0R","BOT1R","BOT2R","BOT3R","BOT4R","BOT5R","BOT6R","BOT7R","BOT8R","BOT9R"};
 //uint8_t txAddr[10][6] = {"BOT0T","BOT1T","BOT2T","BOT3T","BOT4T","BOT5T","BOT6T","BOT7T","BOT8T","BOT9T"};
 
-uint8_t rxAddr[6] = "BTOA0";
-uint8_t txAddr[6] = "ATOB0";
+uint8_t txAddr[6] = "BTOA0";
+uint8_t rxAddr[6] = "ATOB0";
 
 int main() {
-    unsigned char inByte;
+    unsigned char outByte='Q';
     
     led_R=1;
     led_G=1;
@@ -55,10 +55,9 @@
     nrf.startListening();
     
     while(1) {
-        if(nrf.available()) {
-            nrf.read(&inByte, 1);
-            pc.putc(inByte);
-        }
+        wait(0.3f);
+        pc.printf("Transmitted\r\n");
+        nrf.write(&outByte, 1);
     }
 }