blinking led
slowtell
Posts: 5
i am building an industrial controller with the bs2,· i have a problem when making an out high after sensing an input the led indicator blinks about every 10 seconds
any suggestions
any suggestions
Comments
'{$STAMP BS2}
'{$PBASIC 2.5}
DEBUG "turn on 14 with 1 0"
DEBUG ? IN1
IF(IN1=0)THEN
HIGH 14
HIGH 15
PAUSE 3000
LOW 15
ENDIF
IF(IN1=1)THEN
LOW 14
ENDIF
The following is from the PBASIC help file under the END command....
Once the BASIC Stamp reaches the end of the PBASIC program, it enters low-power mode indefinitely.
In this mode the Stamp's current draw (excluding loads driven by the I/O pins) is reduced .... This keeps the BASIC Stamp inactive until the reset line is activated, the power is cycled off and back on or the PC downloads another program.
Pins will retain their input or output settings after the BASIC Stamp is deactivated. For example, if the BASIC Stamp is powering an LED when the program ends, the LED will stay lit, but every 2.3 seconds, there will be a visible wink of the LED as the output pin switches to the input direction for 18 ms.
This is what may be happening.
Place your program code within some looping structure... DO .... LOOP or LABEL: .... GOTO LABEL
Charlie
·· This was also covered recently in the following thread.
http://forums.parallax.com/showthread.php?p=600080
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com