init

Dependencies:   mbed nRF24L01P

Files at this revision

API Documentation at this revision

Comitter:
ViriJay
Date:
Fri Jan 18 13:24:59 2019 +0000
Parent:
2:8dc7ee41e9a7
Commit message:
timer

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Jan 18 10:52:31 2019 +0000
+++ b/main.cpp	Fri Jan 18 13:24:59 2019 +0000
@@ -12,6 +12,8 @@
 int txDataCnt = 0;
 int rxDataCnt = 0;
 
+bool transmitter = true;
+
 bool ackknowledged = true;
 
 void init() {
@@ -76,18 +78,27 @@
 }
 
 void startTest() {
+    std::chrono::time_point<std::chrono::system_clock> start, end;
     // start timer
+    start = std::chrono::system_clock::now();
     // loop { send getal
     // wacht op ack }
     // send FIN
     // wacht op FIN ACK
     // stop timer
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> duration = end - start;
+    std::cout << "Test duration: " << duration.count() << " seconds\n";
 }
 
 int main() {    
-    cs = 1;
     init();
-    bootup();
+    
+    if (transmitter) {
+        startTest();
+    } else {
+        //listen ofzo
+    }
     
     while (true) {
         readButton();