// begin sending over serial port
beginSerial(9600);
}
void loop(){
// read the value on digital input
value = digitalRead(digitalInput);
// write this value to the control LED pin
digitalWrite(LEDpin, value);
// if value is high then send the letter 'H' else send 'L' for low
if (value) serialWrite('H');
else
serialWrite('L');
// wait a bit to not overload the port
delay(10);
}
But when I intersect the sensor with an object doesnt work. I mean the data printing is always L continously I had try also the button example that goes with arduino but the same thing happen and the led is always on
Does anyone could help me.
These URL have images to explain graphical form the problem
For the sake of debugging, try println(value); to see what's coming off the sensor, increase the delay a little so it doesn't spin out. Then open the serial monitor in the Arduino IDE and see what it's up to.
Sorry for the delay but I dont have a tester so I have to wait for a friend and work on these during the weekend. The volt between the + on the D-side and ground is 5V when I break the path.
I change the GND to 5V and try breaking the path but the samething happen
Before I made the test on the protoboard, we saw a bending circuit that has a Transistor NPN (PN2222A) a LED three resistors (one of 1,5, other of 330 Ohms. and 1 KiloOhms) and it works.
The diagram, the datasheet of the Transistor and the photos of the bending circuit are on the following URL:
www.secox.cl/circuito2.zip
So I think that the circuit is bad made. But I dont know what is the real problem. Any idea?
i couldn't really tell what is going on in your diagram... My guess is maybe you burned out the transistor if you tried a bunch of wiring configurations.
the diagram is not perfect,as I used the symbol for an optoisolator, a close cousin of the slot detector, so you don't see the 'slot' represented between transistor and led.
It's still electrically correct though:
with no led light on the transistor, its C-E junction is 'open', and the collector will be at 5V.
with led light on the transistor, it will conduct and its collector will drop to about .7V, the standard C-E voltage drop for a saturated transistor.
I have try the slot connector but doesnt work I try differents conncetcions with the ap_ReadDigital adn Button applications.
See images www.secox.cl/circuito3.zip
I think the circuits of circuito2 and circuito zip files are well done. But here is something wrong. Do I need other electronic component?
I put in contact with Barbara to mantain one post of the theme.