Shop OBEX P1 Docs P2 Docs Learn Events
hyperterminal setting output pin high without using Basic stamp editor — Parallax Forums

hyperterminal setting output pin high without using Basic stamp editor

vijaykumarvijaykumar Posts: 2
edited 2009-08-31 22:39 in BASIC Stamp
I want to use Hyperterminal using the basic stamp homework board in a stand alone mode.
I want to control the board through the hyperterminal.
For example:
I want to set output pin 14 high using the hyperterminal
Can I type in hyperterminal· HIGH 14 and set the output pin?
I tried it and does not work.
Do I need the basic stamp to be running a program?
I searched through forums and could not find the information.
Any reference or information will be useful.

·

Comments

  • sylvie369sylvie369 Posts: 1,622
    edited 2009-08-31 21:25
    Hyperterminal will not work as a Basic interpreter. It simply communicates with whatever is attached to the port it's connected to.

    You could write a program and load it to the Stamp to interpret input from Hyperterminal. I'll bet there's a FAR easier way to do whatever you're trying to do, though. What's the project?
  • dev/nulldev/null Posts: 381
    edited 2009-08-31 21:41
    myvar VAR Byte 
    
    DEBUGIN DEC1 myvar
    
    SELECT myvar
      CASE 1 : HIGH 14
      CASE 2 . HIGH 13
      ' etc....
    ENDSELECT
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-31 21:49
    The only way to program the Stamp built into the Homework Board is to use the Stamp Editor. Once a program is downloaded to the Stamp, it can function completely independently of the Stamp Editor. You could write a program that looks at the serial port used for programming and interprets what's typed there from something like Hyperterminal, then performs some action on the Stamp. For example, you could have a program that waits for an "H" or "L" to be typed, followed by a decimal number, then sets that I/O pin to high or low like:
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    cmd    var  byte
    thePin var  nibble
    main:
      debugin cmd  ' Input a byte from the programming port
      if cmd = "H" then  ' Is it "H"?
        debugin dec thePin  ' If so, read a decimal value delimited by a non-digit
        high thePin  ' Set that pin high
      elseif cmd = "L" then  ' Same thing for "L" and setting the pin low
        debugin dec thePin
        low thePin
      endif
      goto main
    


    Note that this code does no error checking. That can be added.
  • vijaykumarvijaykumar Posts: 2
    edited 2009-08-31 22:10
    Mike,
    Your idea worked.
    Only change I had to make was to make thePin Var nib instead of nibble.
    Thanks.

    Sylvie,
    I am trying to write a higher level program with Visual Basic to work with the homework board.
    I am trying to understand how BS2 works so that I can write a program in Visual Basic.
    I wanted to know whether a program needs to be running in the board or the BS2 was intelligent enough to work directly with a hyperterminal.
    From Mike's answer and yours I understand that one has to run a program in the board to be listening to the serial port for the hyperterminal to work.
    I also saw in the web site information on tokenizers which I think can be used with Visual Basic.
    I will read some more on this.
    Thanks.
    Vijay
  • dev/nulldev/null Posts: 381
    edited 2009-08-31 22:39
    In VB.net you just add a SerialPort control to your form, and use the Write() function, and DataReceived() event if you want to receive data from the Stamp.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
Sign In or Register to comment.