INs and OUTs
Hello,
I need to have out(nibble) follow the In(nibble)
outa = inb for instance.
I tried what I thought might work but i'm uncertain of the syntax
required. Also, would Ina's LSB be port 0, or would P0 equal MSB, i
need the two to follow each other exactly.
Thanks
I need to have out(nibble) follow the In(nibble)
outa = inb for instance.
I tried what I thought might work but i'm uncertain of the syntax
required. Also, would Ina's LSB be port 0, or would P0 equal MSB, i
need the two to follow each other exactly.
Thanks
Comments
writes:
> I need to have out(nibble) follow the In(nibble)
> outa = inb for instance.
> I tried what I thought might work but i'm uncertain of the syntax
> required. Also, would Ina's LSB be port 0, or would P0 equal MSB, i
>
What you did should have worked -- so long as you initialized the DIR pins
accordingly (the Stamp initializes every pin to input). Try this:
DirA = %1111 ' outputs
DirB = %0000 ' inputs (redundant - done for clarity)
Loop:
OutA = InB ' P4 -> P0, P5 -> P1, P6 -> P2, P7 -> P3
' do something else
GOTO Loop
If you were thinking that you could use aliases to make the process
automatic, you can't. You can cause a program variable to follow inputs, but
you cannot cause an output variable to follow anything since output variables
have a fixed location.
-- Jon Williams
-- Parallax
[noparse][[/noparse]Non-text portions of this message have been removed]
Here is what I tried: (looks similar)
dirc=1111 'nibc outputs
detectWhatever var inb 'set variable
showMeWhatever var detectWhatever
start:
detectWhatever
debug outc=showMeWhatever 'prompts for bin. info
debug outc=%showMeWhatever 'same error
I need to set the input nib to a variable for later compairisons,
also so the "outc" doesn't go and and inb again, just to ensure the
variables don't change until the next loop
--- In basicstamps@y..., jonwms@a... wrote:
> In a message dated 2/3/02 2:51:46 PM Central Standard Time,
cbielek@y...
> writes:
>
>
> > I need to have out(nibble) follow the In(nibble)
> > outa = inb for instance.
> > I tried what I thought might work but i'm uncertain of the syntax
> > required. Also, would Ina's LSB be port 0, or would P0 equal MSB,
i
> >
>
> What you did should have worked -- so long as you initialized the
DIR pins
> accordingly (the Stamp initializes every pin to input). Try this:
>
> DirA = %1111 ' outputs
> DirB = %0000 ' inputs (redundant - done for clarity)
>
> Loop:
> OutA = InB ' P4 -> P0, P5 -> P1, P6 -> P2, P7 -> P3
> ' do something else
> GOTO Loop
>
>
> If you were thinking that you could use aliases to make the process
> automatic, you can't. You can cause a program variable to follow
inputs, but
> you cannot cause an output variable to follow anything since output
variables
> have a fixed location.
>
> -- Jon Williams
> -- Parallax
>
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
dirc=%1111
detectwhatever=inb
showmewhatever=detectwhatever
debug detectwhatever, cr
debug outc=showmewhatever, cr
......as an alias showmewhatever will not inb correct?
so then i should be ok to use showmewhatever in a lookdown for
instance without having the variable change until detectwhatever is
called again
--- In basicstamps@y..., "cbielek" <cbielek@y...> wrote:
> Not sure what you mean about having an output variable follow...
>
> Here is what I tried: (looks similar)
> dirc=1111 'nibc outputs
> detectWhatever var inb 'set variable
> showMeWhatever var detectWhatever
>
> start:
>
> detectWhatever
> debug outc=showMeWhatever 'prompts for bin. info
> debug outc=%showMeWhatever 'same error
>
>
> I need to set the input nib to a variable for later compairisons,
> also so the "outc" doesn't go and and inb again, just to ensure the
> variables don't change until the next loop
>
> --- In basicstamps@y..., jonwms@a... wrote:
> > In a message dated 2/3/02 2:51:46 PM Central Standard Time,
> cbielek@y...
> > writes:
> >
> >
> > > I need to have out(nibble) follow the In(nibble)
> > > outa = inb for instance.
> > > I tried what I thought might work but i'm uncertain of the
syntax
> > > required. Also, would Ina's LSB be port 0, or would P0 equal
MSB,
> i
> > >
> >
> > What you did should have worked -- so long as you initialized the
> DIR pins
> > accordingly (the Stamp initializes every pin to input). Try this:
> >
> > DirA = %1111 ' outputs
> > DirB = %0000 ' inputs (redundant - done for clarity)
> >
> > Loop:
> > OutA = InB ' P4 -> P0, P5 -> P1, P6 -> P2, P7 -> P3
> > ' do something else
> > GOTO Loop
> >
> >
> > If you were thinking that you could use aliases to make the
process
> > automatic, you can't. You can cause a program variable to follow
> inputs, but
> > you cannot cause an output variable to follow anything since
output
> variables
> > have a fixed location.
> >
> > -- Jon Williams
> > -- Parallax
> >
> >
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]