Jared Baxter
/
Impedance_Fast_Circuitry
Impedance Fast Circuitry Software
Fork of DSP_200kHz by
Diff: main.cpp
- Revision:
- 86:b3520f4453cf
- Parent:
- 85:f1be018aacac
- Child:
- 87:80c9169acb85
--- a/main.cpp Wed Apr 25 16:21:11 2018 +0000 +++ b/main.cpp Fri Jun 22 18:13:46 2018 +0000 @@ -49,6 +49,9 @@ 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,20 +186,29 @@ 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 { while(pc.readable())//if there is a Keyboard input { - 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"); } }