Shop OBEX P1 Docs P2 Docs Learn Events
Help! Some problem with syntax — Parallax Forums

Help! Some problem with syntax

pastageekpastageek Posts: 5
edited 2008-08-08 15:00 in BASIC Stamp
Every time I try to use the SERIN command problems ensue with the variable with the do while loop or some other Smile happens. here is my code:
' {$STAMP BS2}
' {$PBASIC 2.5}
  T9600 CON 84
  Inverted CON $4000
  Baud9600  CON T9600 + Inverted
letter VAR Byte   
SERIN 16, Baud9600,letter ,
counter VAR Byte
DO
 
  SELECT letter
    CASE "0"
      LOW 5
      FOR counter = 0 TO 127
        PULSOUT 6, 1
        PAUSE 1
      NEXT
    CASE "L"
      LOW 5
      FOR counter = 0 TO 10
        PULSOUT 6, 1
      NEXT
    CASE "H"
      HIGH 5
      FOR counter = 0 TO 10
        PULSOUT 6, 1
      NEXT
    CASE "1"
      HIGH 15
    CASE "2"
      HIGH 14
    CASE "4"
      HIGH 13
    CASE "8"
      HIGH 12
    CASE "a"
      LOW 15
    CASE "b"
      LOW 14
    CASE "c"
      LOW 13
    CASE "d"
      LOW 12
    CASE "n"
      HIGH 0
    CASE "f"
      LOW 0
ENDSELECT
LOOP

I was following the example from: http://www.c-sharpcorner.com/UploadFile/mgold/FlashingStockAlert09152006184241PM/FlashingStockAlert.aspx

Please help. thanks.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-08-08 14:01
    It's kind of hard to tell what you've done because the forum software can "gobble up" square brackets since it uses them for formatting.
    The easiest way around this is to put a space after the opening square bracket. Do read the chapter in the PBasic Manual on the SERIN
    statement. What you've written doesn't make sense for a simple SERIN statement even with the forum software's behavior.

    It's also helpful for you to include only the code that illustrates the problem plus whatever support routines are called. In your case, the
    long SELECT / CASE statement isn't necessary and just adds bulk to the posting. What problem are you having?
  • Adrian SchneiderAdrian Schneider Posts: 92
    edited 2008-08-08 14:09
    The serin-line must read:
    SERIN 16, Baud9600,[noparse][[/noparse]letter]
    



    Adrian
  • pastageekpastageek Posts: 5
    edited 2008-08-08 15:00
    Thanks for your help. I'm just newb at the syntax that's all (not much time these days). I think you gave me what I need. Ok so the project that this is for is for the demo of the science IDE project where I am integrating all the sciences together with a C# GUI that allows one to parse through scientific data including well formatted equations from math and chem and bring the SVN and other types of tools common to computing to the scientific community including sharing lab resources via network and constructing digital/analogue/mechanical interfaces with equipment making the controller cards based around the pic microcontroller.
Sign In or Register to comment.