diff --git a/main.c b/main.c index 6186d55fbdf7e9b44ae5d2a109c48bc16256ea29..4911d2fd39bf211f817adc03cc4cfe9c18f690df 100644 --- a/main.c +++ b/main.c @@ -33,11 +33,11 @@ int main() { //Update temperature display every second //Infinite loop - while(1) { - uint16_t raw = adc_read(); //Define a variable to store the raw output value from the adc + while (1) { + uint16_t raw = adc_read(); //Define a variable to store the raw output value from the adc //Do the conversion - const float conversion = 3.3f / (1<<12); + const float conversion = 3.3f / (1 << 12); float voltage = raw * conversion; // convert raw value to voltage float temperature = 27 - (voltage - 0.706) / 0.001721; // convert voltage to temperature value @@ -52,3 +52,4 @@ int main() { //wait 1 sec sleep_ms(1000); } +}