Shop OBEX P1 Docs P2 Docs Learn Events
blinking led — Parallax Forums

blinking led

slowtellslowtell Posts: 5
edited 2006-08-11 15:12 in BASIC Stamp
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

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-08-10 18:08
    Yes. Please provide more detail. What "LED Indicator"? Is the "LED Indicator" connected to the "out high"? What's on the input?
  • slowtellslowtell Posts: 5
    edited 2006-08-10 20:23
    I have a led with resistor on p14, the input is p1, code turns on 14 when p1 is 0 and it should stay on, however about every 10 seconds it blinks
  • slowtellslowtell Posts: 5
    edited 2006-08-10 20:25
    here is the code i am using

    '{$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
  • Charlie JohnsonCharlie Johnson Posts: 147
    edited 2006-08-10 20:36
    Slowtell,

    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
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-08-10 20:58
    Hello,

    ·· 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
  • slowtellslowtell Posts: 5
    edited 2006-08-11 15:12
    thanks for the info
Sign In or Register to comment.