Something wrong with my Duemilanove. I have a temp sensor hooked up to read on Analog 0 and the serial window displays letters instead of numbers. At first I thought it was a problem with the baud setting or the sensor but I tired 2 of them. Also, I get the same issue with a different baud setting for the serial port. I held the temp sensor between my fingers to note what would happen in the serial monitor and the letter L changed to M then to N, O P Q R etc as the temperature increased. What's going on here. Tell me my arduino isn't toast? I can upload sketches no problem but the serial output is screwed up.
No you haven't toasted it you are just sending the wrong stuff. Can you post the sketch (between code brackets) so we can see what you have done wrong.
This is the code. I think it's correct. I really think it could be hardware or something as sometimes it wont power up with USB but does with the battery pack. I've been trying different usb cables, computers with different results.
//declare variables
float tempC;
int tempPin = 0;
void setup()
{
Serial.begin(9600); //opens serial port, sets data rate to 9600 bps
}
void loop()
{
tempC = analogRead(tempPin); //read the value from the sensor
tempC = (5.0 * tempC * 100.0)/1024.0; //convert the analog data to temperature
Serial.print((byte)tempC); //send the data to the computer
delay(1000); //wait one second before sending new data
}
Actually, I just replaced Serial.print((byte)tempC);
with
Serial.print((float)tempC); and that seemed to fix it.
I dont' recall having made that change. I'm gonna have to keep an eye on this in any case. Thanks for allowing me a chance to look at the code once more. I was starting to get worried here