#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
float tempC; // create variable to store the temperature in.
int tempPin = 0; // Attach vout to analog pin 0.
void setup() // Will execute once at the start of the code.
{
Serial.begin(9600);
lcd.begin(16, 2);
lcd.clear();
}
void loop() // code here will continue to replay until powered off.
{
tempC = analogRead(tempPin); // read the analog value from the lm335 sensor.
tempC = (5.0 * tempC * 100.0)/1024.0; // convert the analog input to temperature in centigrade.
Serial.println((byte)tempC);
Serial.println((byte)tempPin); // send the data to the computer.
delay(3000); // wait 3 seconds before redoing the loop.
}
not printing to the display for now for reasons of troubleshooting. Here, i will consistently get the number 28-30, followed by a zero.
this means that tempC = 28-30, and that tempPin = 0?!?