Update main.c read 10 times and show us

beta-add
Alan Johnston 2 years ago committed by GitHub
parent 389e77f0a7
commit 9388650d72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -2190,9 +2190,11 @@ void read_adc()
sleep(1);
long int time_start;
while (1) {
int i = 0;
time_start = (long int) micros(); //millis();
while (i++ < 10) {
// Read 1 byte of data
char data[1]={0};
if(read(file, data, 1) != 1)
@ -2205,7 +2207,9 @@ void read_adc()
int raw_adc = data[0];
// Output data to screen
printf("Digital value of analog input: %d in %d us\n", raw_adc, micros() - time_start); // millis() - time_start);
// printf("Digital value of analog input: %d in %d us\n", raw_adc, micros() - time_start); // millis() - time_start);
}
}
printf("Digital value of analog input: %d in %d us\n", raw_adc, micros() - time_start); // millis() - time_start);
}

Loading…
Cancel
Save

Powered by TurnKey Linux.