Simply turning on an LED
Perianne
Posts: 4
Hi. I am new to basic stamp.
I bought a basic stamp and a 32213 motion detector. I used the program with the motion detector. Everything works fine. It detects motion like it should.
I then added a new line or two to turn on an LED when motion was detected. It did as I programmed, except the LED flashed. To make a long story shorter, I cannot get an LED to stay on.
So, I simplified the program to ONLY turn on an LED. Still, it flashes. I am soooo frustrated after working with this for days, looking on the internet for any solution. Finally, I come here. I have attached photos of the program and the board.
I know this is probably very simple, but I don't know where else to turn. Please help me in this very basic program.
I bought a basic stamp and a 32213 motion detector. I used the program with the motion detector. Everything works fine. It detects motion like it should.
I then added a new line or two to turn on an LED when motion was detected. It did as I programmed, except the LED flashed. To make a long story shorter, I cannot get an LED to stay on.
So, I simplified the program to ONLY turn on an LED. Still, it flashes. I am soooo frustrated after working with this for days, looking on the internet for any solution. Finally, I come here. I have attached photos of the program and the board.
I know this is probably very simple, but I don't know where else to turn. Please help me in this very basic program.
Comments
The way to prevent this is to have your program hang in a loop at the end. Use "DO : LOOP" before the END statement. If you just want to see the LED light for 10 seconds, put a "PAUSE 10000" before the END statement.
My program was indeed in "sleep mode". I had cut the program down too much.
Anyway, when I put in the DO LOOP. It still flashes, though now at a regular rate. And, the "running" LED on the board stays lit. I also tried the "PAUSE 10000" and it keeps the "running" LED on, but the LED still flashes at a regular rate.
Thank you for your help.
I didn't see it in the above discussion, but LOW 0 will turn the LED off. Put a PAUSE 10000 after that to see it stay off for ten seconds.
More importantly, welcome to the forums! All questions are answered!
Thank you, Ken, for replying. Turning the LED off is not a problem. But, I did find (with help) the solution. See below.
Again, Mike, thanks. I did not have another LED, but I put my multimeter on the I/O port and found it to be steady 5V. Thanks to your advice, I pulled the package the LED came in and right on the package it says "Blinking". I have never heard of a self-blinking LED, lol. I think I have been away from electronics too long (about 10 years). Anyway, the circuit - and all of them that I programmed - have been working. It was just the crazy blinking LED. That, and the "sleep mode" have solved my problems.
I thank you for your help and feel silly.
Peri
-Tommy