Update main.c print ms

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

@ -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);
}
}
}

Loading…
Cancel
Save

Powered by TurnKey Linux.