unsigned long start_time1,start_time2,stop_time1,stop_time2; const int smpl=5000; unsigned long values[smpl]; void setup() { Serial.begin(115200); ADC->ADC_MR |= 0x80; //set free running mode on ADC //ADC->ADC_CHER = 0x80; //enable ADC on pin A0 ADC->ADC_CHER = 0xC0; //enable ADC on pin A0 and A1 } void loop() { unsigned int i; //incrementing variable int val1, val2 = 0; //initialize bit variables, set value to 0 //start_time1 = micros(); //Starts timer to measure speed of below loop for(i=0;iADC_ISR & 0xC0)==0x00);// checks analog channel, when case is true conversion is complete [ADC_ISR is the interrupt status resister] /* read analog channels, data saved to variables and subtracted*/ val1=ADC->ADC_CDR[7]; //get values from pin A0 [ADC channel 7] val2=ADC->ADC_CDR[6]; //get values from pin A1 [ADC channel 6] values[i]=val1-val2+2048; //value array } // stop_time1 = micros(); //Saves value in micro-seconds to variable stop_time1 Serial.print("Total time: "); Serial.println(stop_time1-start_time1); Serial.print("Average time per conversion: "); Serial.println((float)(stop_time1-start_time1)/1000); //start_time2 = micros();//Starts timer to measure speed of serial communications Serial.println("Values: "); for(i=0;i