Delay Loop and Serial Return to PC Help/ Thermistor Project Help

All,

I am really stuck on this week’s lab

Part I.

void setup () {

Serial.begin(9600);

}

void loop () {

#include <math.h>

double Thermistor(int RawADC) {

double Temp;

Temp = log(10000.0*((1024.0/RawADC-1)));

// =log(10000.0/(1024.0/RawADC-1)) // for pull-up configuration

Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp

))* Temp );

Temp = Temp - 273.15; // Convert Kelvin to Celcius

Temp = (Temp * 9.0)/ 5.0 + 32.0; // Convert Celcius to Fahrenheit

return Temp;

Serial.println (“Temp”);

delay (1000);

}

Is this how you would get it to delay 1 sec and also print back to the PC serially? Also, theoretically, if I am able to run my code, let’s say I have the following temperature values that post in Excel:

94

95

96

98

99

101

105

…etc. Is the time constant of the thermistor just the change in temperature aka the slope?

Thank you!

Lauren Quinones

return Temp;

The above line should be moved after delay() .

delay() is a blocking function and not recommended.

So if I remove the above Serial.Print In, how do I get it to print serially back to the PC? And how would I get it to repeat each second if I can't use delay?

Not remove, ‘move’.

How and Why to avoid delay(): http://playground.arduino.cc/Code/AvoidDelay

Demonstration code for several things at the same time. http://forum.arduino.cc/index.php?topic=223286.0