From d28b47c2ae1bda3d418a7d1fc992457331caab06 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 22 May 2024 23:06:05 -0400 Subject: [PATCH] Update main.c print ms --- main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index cdd361e9..55850ce2 100644 --- a/main.c +++ b/main.c @@ -2189,6 +2189,10 @@ void read_adc() write(file, config, 1); sleep(1); + long int time_start; + + while (1) { + time_start = (long int) millis(); // Read 1 byte of data char data[1]={0}; if(read(file, data, 1) != 1) @@ -2201,6 +2205,7 @@ void read_adc() int raw_adc = data[0]; // Output data to screen - printf("Digital value of analog input: %d \n", raw_adc); + printf("Digital value of analog input: %d in %d ms\n", raw_adc, millis() - time_start); + } } }