Shop OBEX P1 Docs P2 Docs Learn Events
Newbie: need solid output — Parallax Forums

Newbie: need solid output

RLmiller777RLmiller777 Posts: 9
edited 2012-10-17 19:12 in General Discussion
'stamp bs2...
pause 1000
high 6


6 goes to a relay and keeps going off and on. its not a solid ON.

why? and what is the correct code?

thanks in advance.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-10-17 17:04
    It's impossible to advise you without more information. What you posted is not a complete program. Download and look at "What's a Microcontroller?" as well as the "Basic Stamp Syntax and Reference Manual". These are the main references and educational material for the Stamps. Nuts and Volts Column #6 discusses how to control a relay and gives circuit examples. You may need a switching transistor and snubber diode as shown there.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-17 17:05
    What kind of relay?
    (I'm suspecting a low-resistance one with no flyback diode)

    Say on.
  • PublisonPublison Posts: 12,366
    edited 2012-10-17 17:05
    'stamp bs2...
    pause 1000
    high 6


    6 goes to a relay and keeps going off and on. its not a solid ON.

    why? and what is the correct code?

    thanks in advance.

    Is that you entire code?

    PAUSE 1000
    wait 1 second
    HIGH 6
    engage relay

    The program will stop here without a repeat.

    If the relay is engaging and disengaging, it is probably due the BS2 resetting because of too much of a current draw on the battery.

    Could you provide a schematic and the model number of the relay. A picture would help also.

    BTW welcome to the forums!
  • RLmiller777RLmiller777 Posts: 9
    edited 2012-10-17 17:21
    it pulses off on a cycle or regulary like. it does it on lighting a simple diode. I thought you guys would know . Thanks for the welcome to the forum.
    im still learning how to post stuff too. Thanks for any help.
  • RLmiller777RLmiller777 Posts: 9
    edited 2012-10-17 17:31
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    PAUSE 1000
    DEBUG "Program running",CR
    HIGH 6
    'PAUSE 600
    'LOW 6
    END

    very simple circuit. I verified that the transistor and the relay is hooked up right. im going thru a transistor to the relay. There is a common ground and separate power supply for the breadboard. The stamp does not work like I thought it should. Right now Im playing with a flip flop since the stamp is not steady.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-17 17:38
    Get rid of "END"
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-17 17:43
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    DIRL = $FF
    
    OUT6 = 0
    PAUSE 1000
    DEBUG "Program running",CR
    OUT6 = 1
    ' Output will stay HIGH from hereon
    
    

    ..
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    DIRL = $FF
    
    OUT6 = 0
    PAUSE 500
    DEBUG "Program running",CR
    OUT6 = 1
    PAUSE 2000
    OUT6 = 0
    ' Output will stay LOW from hereon
    

    Should have taken this up in "Basic Stamp".
  • RLmiller777RLmiller777 Posts: 9
    edited 2012-10-17 17:51
    Thank you, that worked. There are so many ways to turn that thing on and off. BY the way

    in the commands what is Dir short for ? Directory? Direct?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-17 18:00
    It's DIRection
  • RLmiller777RLmiller777 Posts: 9
    edited 2012-10-17 18:00
    "Should have taken this up..."
    > sorry to have troubled you.

    please tell me where the Newbies are posting dumb questions so i can go there.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-10-17 18:03
    Reply 9 vs Reply 11 -- What gives?
  • JLockeJLocke Posts: 354
    edited 2012-10-17 18:08
    This is from the Basic Stamp Manual (page 83): When the BASIC Stamp is powered up, or reset, all memory locations are cleared to 0, so all pins are inputs (DIRS = 00000000000000). Also, if the PBASIC program sets all the I/O pins to outputs (DIRS = 11111111111111), then they will initially output low, since the output latch (OUTS) is cleared to all zeros upon power-up or reset, as well.

    What do you mean by "Ive got 6 reading from my meter now"?

    No problem with posting here, but for Basic Stamp questions, you're likely to get faster assistance by posting in the Basic Stamp sub-forum.
  • RLmiller777RLmiller777 Posts: 9
    edited 2012-10-17 18:23
    Thanks for the page number. Im back to studying the book.
  • NWCCTVNWCCTV Posts: 3,629
    edited 2012-10-17 19:12

    please tell me where the Newbies are posting dumb questions so i can go there.

    I do not believe anyone in the Parallax community would ever think of a question as "dumb". The main Parallax Forums page http://forums.parallax.com/forum.php lists each of the Forums by topic and has a short explanation of what each Forum covers. When posting code it is best to use code wrappers. Also, try to be as specific as possible with your question or issue. You will find it is much easier to get a reliable response that way. There are many people here that are willing to help out. I second publison and say welcome.
Sign In or Register to comment.