So currently I am using an Uno to design a controller for my beer brewing bench. Eventually I will be using my Yun for the final. I will require using three temp sensors in the whole scheme of things. Currently I am working with TMP36's. I will also be playing with Dallas sensors later. The following code is what I am using:
//TMP36 Pin Variables
int temperaturePin1 = 0;
int temperaturePin2 = 1;
int temperaturePin3 = 2;
void setup()
{
Serial.begin(9600);
}
void loop()
{
float temperature1 = getVoltage(temperaturePin1);
temperature1 = (((temperature1 - .5) * 100) * 1.8) + 32;
((volatge - 500mV) times 100)
Serial.print(temperature1);
Serial.println(" Degrees Fahrenheit Pin 1");
delay(5000);
float temperature2 = getVoltage(temperaturePin2);
temperature2 = (((temperature2 - .5) * 100) * 1.8) + 32; ((volatge - 500mV) times 100)
Serial.print(temperature2);
Serial.println(" Degrees Fahrenheit Pin 2");
delay(5000);
float temperature3 = getVoltage(temperaturePin3);
temperature3 = (((temperature3 - .5) * 100) * 1.8) + 32;
((volatge - 500mV) times 100)
Serial.print(temperature3);
Serial.println(" Degrees Fahrenheit Pin 3");
delay(5000);
}
float getVoltage(int pin){
return (analogRead(pin) * .004882814);
}
Its the ardx.com/code10 modified by me. The results I am experiencing seem fine so far but I have not done any calibrating yet.
My question is, does anyone see any problem that I would have using the code that I currently am using? Meaning currently this will run efficient? As I go along I will add smoothing code after calibrating the sensors.
I have less than 1500 hours of coding experience and that was with Visual Basic. I make my way but takes a while. Thanks in advance!