so when i use the serial monitor i gives me a constant value of 227 could u please help me i am using analog pin zero
and heres my code
#define SENSOR 0 // select the input pin for the
// sensor resistor
int val = 0; // variable to store the value coming
// from the sensor
void setup() {
Serial.begin(9600); // open the serial port to send
// data back to the computer at
// 9600 bits per second
}
void loop() {
val = analogRead(SENSOR); // read the value from
// the sensor
Serial.println(val); // print the value to
// the serial port
delay(100); // wait 100ms between
// each send
}
Have you tried sending some infrared signal to the sensor to see if the value changes? For example using your television remote and pressing buttons while aiming it at the sensor.
richard,
i checked if the infrared detedtor changed voltager when a pointesd the remote and pressed a button
and
after removing my sensor from the arduino i tried the serial port and it kept on showing werid values
thanks richard my analouge input iz perfect cheked out hte problem is with the ir receiver it dosent have ambient ir protection found i t out after googling a lot and thanks a lot for your advice! :-[