From 9388650d72c6a8e975eabfae263fb655d4eb82a0 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 22 May 2024 23:13:35 -0400 Subject: [PATCH] Update main.c read 10 times and show us --- main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index b8af669d..ef866dec 100644 --- a/main.c +++ b/main.c @@ -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); + }