Jared Baxter / Mbed 2 deprecated Impedance_Fast_Circuitry_print_V_I

Dependencies:   mbed-dsp mbed

Fork of Impedance_Fast_Circuitry by Jared Baxter

Revision:
86:850351993d88
Parent:
85:f1be018aacac
--- a/main.cpp	Wed Apr 25 16:21:11 2018 +0000
+++ b/main.cpp	Fri Jun 22 17:57:22 2018 +0000
@@ -49,6 +49,8 @@
 DigitalIn sw2(SW2);//Button 2 Currently not being used
 DigitalIn sw3(SW3);//Button 3 Currently not being used
 
+Timer timer;
+
 // defined in dma.cpp
 extern int len;
 extern uint16_t static_input_array0[];//ADC 0(swaps between a0 and a1.  Used to measure current)
@@ -183,7 +185,8 @@
     pdb_start();
     bool is_actively_printing = false;
     char read_in_character = 'a';
-    //while(print_buffer_count<PRINT_BUFFER_LENGTH) 
+    //while(print_buffer_count<PRINT_BUFFER_LENGTH)
+    timer.start();
     while(!GATHER_STATISTICS||print_buffer_count<PRINT_BUFFER_LENGTH)
     {
         if(pc.readable())//if the python code has sent any characters recently
@@ -192,11 +195,21 @@
             {
                 read_in_character = pc.getc();// read the keyboard input
                 if (read_in_character == 'R')//start printing
+                {
+                    timer.reset();
+                    //timer.start();
                     is_actively_printing = true;
+                }
                 else if (read_in_character == 'S')//Stop printing
+                {
+                    //timer.stop();
                     is_actively_printing = false;
+                }
                 else if (read_in_character == 'P')//return probe number
                     pc.printf("p%d",probe_number);
+                else if (read_in_character == 'I')//return probe number
+                    pc.printf("IMPEDANCE");
+                
             }
             
         }