idk why my ir sensor is just showing 1, in fact i tried all my sensor with their respective WORKING codes(previously)but now suddenly they don't work properly as well.Any help would be appreciated.
this is the ir sensor code:
int sensor = 7;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int data = digitalRead(sensor);
Serial.println(data);
delay(100);
}
what more it is a proximity Sensor are used to detect objects and obstacles in front of sensor . Sensor keeps transmitting infrared light and when any object comes near, it is detected by the sensor by monitoring the reflected light from the object.
Please take a clear photo of your hardware setup, and post it.
Unless you have a time machine, the fact that it worked yesterday is not particularly helpful.
I see three requests for information about the sensor, still no useful response... except that I now know that it is the reflective type, but that isn't really helpful in itself.
Typically, I find when I run into it worked yesterday means that I did something between yesterday and now to frack things up. I then try to remember the last few things I did to the project and undo those things.
Without the code or a pic of the setup and with a vague issue description, most likely the issue is within the period of was the last few things done and only you know what that was, OP.