Hi Everyone.
I tried some simple searches for my problem with no luck. So, I hope you can help really quick. Thanks in advance.
I have a very simple circuit on a breadboard that simply flashes an LED. The program is supposed to look for a contact closure on Pin 3 and then go to a subroutine to flash the LED, then return to the main and look for the contact closure again.
The problem is that as soon as I apply power, the LED starts to flash in the subroutine and will not stay in the main.
Here is the program:
main:
if pin3 = 1 then flash
goto main
flash:
high 4
pause 500
low 4
pause 500
high 4
pause 500
low 4
goto main
This is probably the simplest way for me to flash the LEDs on pin4 without anything fancy.
Right now, pin3 is open. when I apply power, the led starts to flash regardless of what I do to pin3. Someitmes, the led stops flashing. So, then, I just jumper 5 volts form my main power to pin3 adn the flahsing starts.... but many times, it doesnt stop for 3-4+ cycles. Seems too touchy.
When I tested pin3 with a voltmeter, I see a very small voltage of .01-.03 volts. Is this enough to trigger pin3 as on?
should I be initializing pin3 as input or something?
This just seems so simple and I'm not sure why it is a problem. Thanks again for any help.
I tried some simple searches for my problem with no luck. So, I hope you can help really quick. Thanks in advance.
I have a very simple circuit on a breadboard that simply flashes an LED. The program is supposed to look for a contact closure on Pin 3 and then go to a subroutine to flash the LED, then return to the main and look for the contact closure again.
The problem is that as soon as I apply power, the LED starts to flash in the subroutine and will not stay in the main.
Here is the program:
main:
if pin3 = 1 then flash
goto main
flash:
high 4
pause 500
low 4
pause 500
high 4
pause 500
low 4
goto main
This is probably the simplest way for me to flash the LEDs on pin4 without anything fancy.
Right now, pin3 is open. when I apply power, the led starts to flash regardless of what I do to pin3. Someitmes, the led stops flashing. So, then, I just jumper 5 volts form my main power to pin3 adn the flahsing starts.... but many times, it doesnt stop for 3-4+ cycles. Seems too touchy.
When I tested pin3 with a voltmeter, I see a very small voltage of .01-.03 volts. Is this enough to trigger pin3 as on?
should I be initializing pin3 as input or something?
This just seems so simple and I'm not sure why it is a problem. Thanks again for any help.