Shop OBEX P1 Docs P2 Docs Learn Events
translating code for the basicStamp to basicStamp II — Parallax Forums

translating code for the basicStamp to basicStamp II

ArchiverArchiver Posts: 46,084
edited 2004-04-04 17:56 in General Discussion
Hi group,

I'v hooked up a 4051 multiplexer to my basicstamp II, and when I went to try
the example code from the nuts and volts column it was for a basicStamp I,
so it's not to different, but I can't seem to wrap by head around

let pins = pot_sel

and how it relates to

Let dirs = %0111

the rest of the sample program from the nuts and volts column to put the two
exerts into context is:

SYMBOL pot_sel = b2
SYMBOL pot_val = b3

Let dirs = %0111
Again:
for pot_sel = 0 to 7
let pins = pot_sel
pot 3, 150, pot_val
debug "pot #", #pot_pot_sel," ",#pot_val, cr
next pot_sel
pause 2000
debug cr
goto Again

Any where abouts where any info, or translation is available will be life
altering.
thanks,
sincerely,
jeff alten

_________________________________________________________________
MSN Premium helps eliminate e-mail viruses. Get 2 months FREE*
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://\
hotmail.com/enca&HL=Market_MSNIS_Taglines

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-04-04 17:41
    There was -- at one time -- a document that described BS1 to BS2
    updating, but I haven't seen it for a long time. What you might
    consider doing is using our latest editor. You can go to the help
    section and see if a BS1 keyword is available for the BS2.

    In your program, for example, you have the POT keyword. If you look-up
    POT in the help file, you'll see it only works on the BS1, but you'll be
    linked to the RCTIME keyword which performs a similar function on the
    BS2 family. Of course, you will have to declare your variables, set
    your IO, and adjust the DEBUG output as well.

    If you read section four of the manual (also in help now) it will
    describe the architecture of the BS2 memory -- with that knowledge and
    checking on keywords you should be able to adjust your code and circuit
    so that you can use a BS2.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: Jeff Alten [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=8WtUr8ryqwdhnDHjfOZqFPhLVQflDk4s4jXhNL_LLsZXYbeQfuvw9GKbeD81eBLgKP2qa60ewCvCPQAhD8h3]jeffalten@h...[/url
    Sent: Sunday, April 04, 2004 9:32 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] translating code for the basicStamp to basicStamp
    II


    Hi group,

    I'v hooked up a 4051 multiplexer to my basicstamp II, and when I went to
    try
    the example code from the nuts and volts column it was for a basicStamp
    I,
    so it's not to different, but I can't seem to wrap by head around

    let pins = pot_sel

    and how it relates to

    Let dirs = %0111

    the rest of the sample program from the nuts and volts column to put the
    two
    exerts into context is:

    SYMBOL pot_sel = b2
    SYMBOL pot_val = b3

    Let dirs = %0111
    Again:
    for pot_sel = 0 to 7
    let pins = pot_sel
    pot 3, 150, pot_val
    debug "pot #", #pot_pot_sel," ",#pot_val, cr
    next pot_sel
    pause 2000
    debug cr
    goto Again

    Any where abouts where any info, or translation is available will be
    life
    altering.
    thanks,
    sincerely,
    jeff alten

    _________________________________________________________________
    MSN Premium helps eliminate e-mail viruses. Get 2 months FREE*
    http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU
    =http://hotmail.com/enca&HL=Market_MSNIS_Taglines



    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.

    Yahoo! Groups Links







    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-04 17:56
    1. Convert 'SYMBOL' entries to 'VAR' entries:

    pot_val VAR OUT3 ' 'standard' variable 8-bits
    pot_sel VAR NIB ' This sets 'pot_sel' as a NIBBLE 4bits

    2. Convert other

    ' The 'output' setting (is the pin an input or output)
    ' is done with:
    DIRSa = %0111 ' I think -- is 1 an output? Should be.

    See the manual for what 'POT' has been replaced with.

    The 'LET' is 'old' basic, and is usually optional.
    You do need:

    OUTa = pot_sel ' Sends pot_sel nibble out pins 0,1,2,3




    wrote:
    > Hi group,
    >
    > I'v hooked up a 4051 multiplexer to my basicstamp II, and when I
    went to try
    > the example code from the nuts and volts column it was for a
    basicStamp I,
    > so it's not to different, but I can't seem to wrap by head around
    >
    > let pins = pot_sel
    >
    > and how it relates to
    >
    > Let dirs = %0111
    >
    > the rest of the sample program from the nuts and volts column to
    put the two
    > exerts into context is:
    >
    > SYMBOL pot_sel = b2
    > SYMBOL pot_val = b3
    >
    > Let dirs = %0111
    > Again:
    > for pot_sel = 0 to 7
    > let pins = pot_sel
    > pot 3, 150, pot_val
    > debug "pot #", #pot_pot_sel," ",#pot_val, cr
    > next pot_sel
    > pause 2000
    > debug cr
    > goto Again
    >
    > Any where abouts where any info, or translation is available will
    be life
    > altering.
    > thanks,
    > sincerely,
    > jeff alten
    >
    > _________________________________________________________________
    > MSN Premium helps eliminate e-mail viruses. Get 2 months FREE*
    > http://join.msn.com/?pgmarket=en-
    ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Mar
    ket_MSNIS_Taglines
Sign In or Register to comment.