SOLVED
okay, basically I have a analog temperature sensor I have it attached to my Arduino MEGA 2560 on analog pin A14
if I run the default example code of AnalogReadSerial (of course changing the analog pin)
/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to the serial monitor.
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
This example code is in the public domain.
*/
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A14);
// print out the value you read:
Serial.println(sensorValue);
delay(1); // delay in between reads for stability
}
I get a value of 156 in the Serial monitor. (yes this value changed with temperature as it is suppose to)
when I run this code
void setup()
{
Serial.begin(9600);
}
void loop()
{
int sensorValue = analogRead(A14);
sensorValue =map(sensorValue, 0, 1023, 0, 5);
Serial.println(sensorValue);
delay(1);
}
I just get a big fat 0 in the serial monitor.
Can someone tell me what it going on here? I have been staring at this code for quite sometime and it looks good to me.
Thank you for you help.
Also I am using Arduino 1.0.5 it is set for "Arduino mega 2560 or mega ADK"