So to begin i have a small setup that involves a thermisitor, a bread board , a arduino uno, and a 19K resistor. The components all together read temps and i have reading out in Celsius but i want to convert it to Fahrenheit but i am unsure of where to perform the action, my native language is python so sorry if this is a really simple and dumb mistake
.
thermistor1.ino (536 Bytes)
You want to do them in loop().
i have it so it takes the reading of Celsius and converts it to Fahrenheit but it gives em a error of the f not declared in scope but yet i define it right above where it gets printed
Copy and paste your code here.
If this your code you DO NOT have F declared! Also, single character variables are frowned upon except for use as loop counters.
#define SERIESRESISTOR 19000Â Â
#define THERMISTORPIN A0
void setup(void) {
 Serial.begin(9600);
Â
}
void loop(void) {
 float reading;
reading = analogRead(THERMISTORPIN);
F = (reading * 9/5) + 32;
Â
 Serial.print("Analog reading ");
 Serial.println(F);
 // convert the value to resistance
 reading = (1023 / reading) - 1;  // (1023/ADC - 1)
 reading = SERIESRESISTOR / reading; // 19K / (1023/ADC - 1)
 Serial.print("Thermistor resistance ");
 Serial.println(reading);
 delay(1000);
}
I bet this compiles:
#define SERIESRESISTOR 19000Â Â
#define THERMISTORPIN A0
void setup(void) {
 Serial.begin(9600);
Â
}
void loop(void) {
 float cReading = analogRead(THERMISTORPIN);
 float fReading = (cReading * 9/5) + 32;
Â
 Serial.print("Analog reading ");
 Serial.println(fReading );
 // convert the value to resistance
 cReading = (1023 / cReading) - 1;  // (1023/ADC - 1)
 cReading = SERIESRESISTOR / cReading ; // 19K / (1023/ADC - 1)
 Serial.print("Thermistor resistance ");
 Serial.println(cReading);
 delay(1000);
}
but yet i define it right above where it gets printed
the misconception is partly cause by the compiler working it's way back from the end, commenting out//Serial.println(F); would give F not declared in this scope at lineF = (reading * 9/5) + 32;
Where did you get a 19K ohm resistor ??