Shop OBEX P1 Docs P2 Docs Learn Events
New to Basic Stamp1 n Stamp2 — Parallax Forums

New to Basic Stamp1 n Stamp2

Radio-ActiveRadio-Active Posts: 1
edited 2009-01-08 02:12 in BASIC Stamp
I am new to using the Stamp1 and Stamp2. Ihave a Stamp1 now and just ordered a Stamp2. A friend of mine found a PBasic program and ask me if I could use any of the code for learning the Stamps.

Most of the code I understand. I am trying to to fully understand the serin and serout commands and flow structure.

This is the program line: (This program is for a BS1)

···· SERIN 0,N2400,(252),relay,stat

At the beginning of the program;

···· SYMBOL relay = B3
···· SYMBOL stat = B4

Then a conditional statement is checking 'If Relay=1' then a subroutine and another conditional, 'If Stat=1' then it turns a port on.

Ok, now I know the zero(0) is pin0, I believe the 'N' is for no parity, 2400 is baud rate. The (252) I think is a delay? Relay and Stat are variables. But is the BS1 looking for a certain type of data to put into 'relay' and 'stat'. Like ASCII, Decimal......Or is the variables B3 and B4 mean the numbers have to be binary?

I have order some reading material to learn more about the Stamp1 and Stamp2, but haven't received it as of yet.


Thanks in Advance.

Comments

  • FranklinFranklin Posts: 4,747
    edited 2009-01-08 01:52
    The stamp editor download is what you need to program stamps and comes with really good help files explaining all of this. Since relay is defined as B3, if pin 3 is higher than the point between what is seen as off then it will return a 1 otherwise it will return a 0.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • $WMc%$WMc% Posts: 1,884
    edited 2009-01-08 02:12
    Radio-Active

    Look in some of the recent posts. thiers some really good discussions on serial COM.

    ____$WMc%__

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there·········································· E=$WMc%2
Sign In or Register to comment.