Shop OBEX P1 Docs P2 Docs Learn Events
debug controlled relay (solved) — Parallax Forums

debug controlled relay (solved)

bs2-manbs2-man Posts: 23
edited 2010-02-03 02:06 in BASIC Stamp
I need help programming the bs2 so that when i·type "on" a small relay activates, and when i·type "off" it turns off. plz help me out!

Post Edited (bs2-man) : 2/3/2010 2:57:27 AM GMT

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-02-02 03:17
    Show us what code you have and how you have things hooked together.
    something like \:
    debugin command
    if command = "on" pin 3 high
    if command = "off" pin 3 low
    This is not real code and will not run on the stamp but the idea is sound.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-02-02 13:01
    Look in PBASIC Help -- DEBUGIN
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-02-02 16:18
    PJ Allen said...
    Look in PBASIC Help -- DEBUGIN

    Just checking the latest posts and.....

    WHOA! I somehow missed that command in the manual! Thank you for pointing that out. It will be very useful [noparse]:)[/noparse]
  • bs2-manbs2-man Posts: 23
    edited 2010-02-02 22:39
    i dont have any code at all. i need help making some. plzzzzzzz help me make some.
  • bs2-manbs2-man Posts: 23
    edited 2010-02-02 22:49
    tell me how to change this program to work please:

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    command VAR Word

    DO

    DEBUGIN command

    IF command = "on" THEN

    HIGH 15

    ELSE

    IF command = "off" THEN

    LOW 15
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-02-02 23:12
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
     
    
    '  enter 11 = 1 ON
    '  enter 10 = 1 OFF
     
    stat  VAR  Byte
     
    start:
     
      DEBUGIN DEC1 stat
      IF stat = 1 THEN 
        HIGH 15
      ELSEIF stat = 0 THEN
        LOW 15
      ELSE
        DEBUG "invalid input", CR
      ENDIF
     
    GOTO start
    
    
  • bs2-manbs2-man Posts: 23
    edited 2010-02-02 23:21
    ill tri dat
  • $WMc%$WMc% Posts: 1,884
    edited 2010-02-03 02:06
    bs2-man

    Experiment #34 in the StampWorks book shows some additional ways to communicate between a Stamp and a PC. It also shows ways to get data from sensors and pass them to a PC.

    StampWorks is a free download on the Parallax web page.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA
Sign In or Register to comment.