I'm trying to build a counter circuit with the sensor listed above. I hook it up to the 5V, gnd, and digital pin 3. It has a built-in LED and lights when they are looking at each other. I absolutely cannot get an output out of it on the serial monitor. I am using the program below. Any help?
int sensorPin = 3;
int ledPin = 13;
int sensorValue = 0;
First try to see if turning on the internal pull-up resistor will work.
pinMode(sensorPin,INPUT_PULLUP); // in the setup function
OR
Place a 1K resistor from +5v to the O/P of the sensor.
LarryD:
First try to see if turning on the internal pull-up resistor will work.
pinMode(sensorPin,INPUT_PULLUP); // in the setup function
OR
Place a 1K resistor from +5v to the O/P of the sensor.