mapping a var to output/input?
Archiver
Posts: 46,084
How about:
OUTL = OUTL & %11100001 + (drive * 2)
If you'd change your wiring to I/O 0...I/O 3, it would simply be:
OUTA = drive
Steve
On 11 Mar 01 at 9:04, Mike Eggleston wrote:
> Is there a way to map a nibble to out1-4?
>
> drive var out1 .. out4
>
> Mike
>
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
OUTL = OUTL & %11100001 + (drive * 2)
If you'd change your wiring to I/O 0...I/O 3, it would simply be:
OUTA = drive
Steve
On 11 Mar 01 at 9:04, Mike Eggleston wrote:
> Is there a way to map a nibble to out1-4?
>
> drive var out1 .. out4
>
> Mike
>
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
Comments
drive var out1 .. out4
Mike
mikee@mikee.myip.org writes:
drive var out1 .. out4
Yes, you just need to alias each of the four bits:
drive ·····VAR ····Nib
drv1 ······VAR ····drive.Bit0
drv2 ······VAR ····drive.Bit1
drv3 ······VAR ····drive.Bit2
drv4 ······VAR ····drive.Bit3
[/font]
writes:
drive var out1 .. out4
Yes, you just need to alias each of the four bits:
drive ·····VAR ····Nib
drv1 ······VAR ····drive.Bit0
drv2 ······VAR ····drive.Bit1
drv3 ······VAR ····drive.Bit2
drv4 ······VAR ····drive.Bit3
Oops...it's early and I haven't had enough coffee...that idea won't work for
what you want. ·This time I actually opened up the Stamp compiler. ·After
playing a bit, I'm pretty sure that you can't solve your problem through
definitions only.
[/font]
there are sixteen output pins which are identified in several ways.
each pin can be refered to individually out1, out2, out3
or in bytes outh, outl
or in nibbles...
outa, outb, outc, outd
it in the latestes stamp manual from parallax or in the faq that on the al
williams site
http://www.parallaxin.com or http://www.alwilliams.com
so for example try this
outa=> out0,out1,out2,out3
outb=> out4,out5,out6,out7
etc...
(a very poor example follows )
dirs=%11111111
outa=%1100
outb=%0011
(poor example is done)
i'm pretty sure this is correct. (i don't have my typical resources here).
something useful with this that you may or may not need is breaking down larger
types.
w var word
b var byte
dirs=%111111
outa=w.lowbyte.lownib
outb=b.highnib
i have had a few troubles with getting a particular pin to output (14) using the
dirs variable on the IIsx and had to set them individually
dir0=1
dir1=1
dir2=1
etc...
hope this is what you wanted,
-pete
On Sun, 11 Mar 2001, Mike Eggleston wrote:
> Is there a way to map a nibble to out1-4?
>
> drive var out1 .. out4
>
> Mike
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
--
Peter Green
111 IATL peter-w-green@u...
The Department of Mechanical Engineering office: 319.335.3694
The University of Iowa lab: 319.335.3585
Iowa City, Iowa 52242 fax: 319.335.5669
Thanks
Mike
Peter William Green wrote:
> in the stamp II's there are standard variables which map to the output pins
>
> there are sixteen output pins which are identified in several ways.
>
> each pin can be refered to individually out1, out2, out3
>
> or in bytes outh, outl
>
> or in nibbles...
>
> outa, outb, outc, outd
>
> it in the latestes stamp manual from parallax or in the faq that on the al
williams site
>
> http://www.parallaxin.com or http://www.alwilliams.com
>
> so for example try this
>
> outa=> out0,out1,out2,out3
> outb=> out4,out5,out6,out7
>
> etc...
>
> (a very poor example follows )
>
> dirs=%11111111
>
> outa=%1100
> outb=%0011
>
> (poor example is done)
>
> i'm pretty sure this is correct. (i don't have my typical resources here).
>
> something useful with this that you may or may not need is breaking down
larger types.
>
> w var word
> b var byte
> dirs=%111111
>
> outa=w.lowbyte.lownib
> outb=b.highnib
>
> i have had a few troubles with getting a particular pin to output (14) using
the dirs variable on the IIsx and had to set them individually
>
> dir0=1
> dir1=1
> dir2=1
> etc...
>
> hope this is what you wanted,
>
> -pete
>
> On Sun, 11 Mar 2001, Mike Eggleston wrote:
>
> > Is there a way to map a nibble to out1-4?
> >
> > drive var out1 .. out4
> >
> > Mike
> >
> >
> >
> >
> > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
> >
> >
> >
>
> --
> Peter Green
> 111 IATL peter-w-green@u...
> The Department of Mechanical Engineering office: 319.335.3694
> The University of Iowa lab: 319.335.3585
> Iowa City, Iowa 52242 fax: 319.335.5669
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/