constants
Archiver
Posts: 46,084
hi, another beginner question. How can I use constants to measure the
IN of a pin?
In other words, i don't want to write
x= in7
I'd rather write
my_input con 7
x = in my_input
I can't figure out how to do that without an error...
IN of a pin?
In other words, i don't want to write
x= in7
I'd rather write
my_input con 7
x = in my_input
I can't figure out how to do that without an error...
Comments
my_input var in7
x=my_input
You might enjoy: http://www.wd5gnr.com/stampfaq.htm
Al Williams
AWC
* Floating point A/D
http://www.al-williams.com/awce/pak9.htm
>
Original Message
> From: markallen [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=Ar2VSL-SBU57cx8Zsoi8sx4Oe2pOVfmyOWsSm3jWCaJizpECAg2i9qFmaRjJTqlxrBLvQcY-8Q2iDPquo2yB]mhallen@p...[/url
> Sent: Thursday, April 25, 2002 11:44 AM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] constants
>
>
> hi, another beginner question. How can I use constants to measure the
> IN of a pin?
>
> In other words, i don't want to write
>
>
> x= in7
>
>
> I'd rather write
>
>
> my_input con 7
> x = in my_input
>
>
> I can't figure out how to do that without an error...
>
>
> 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.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
my_input con 7
x = in0(my_input)
This works because in0(7) is the same as in7. It is a tricky (and
very powerful) way that the stamp has of addressing all of its ram
memory as an array. The index of the array acts as an offset.
in0(0) is the same as in0. in0(1) is the same thing as in1, and so
on up to in0(15). The same logic applies to out, i.e., out0(15) is
the same as out15. This is especially useful if you use a variable
as the index.
my_input var nib
for my_input=0 to 15
debug ? in0(my_input)
next
Your program can step through a range of inputs using one subroutine
to perform the same operation on each of them.
-- best regards
Tracy Allen
electronically monitored ecosystems
http://www.emesystems.com
mailto:tracy@e...
>Try
>my_input var in7
>x=my_input
>You might enjoy: http://www.wd5gnr.com/stampfaq.htm
>Al Williams
> >
Original Message
>> From: markallen [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=5e8mEBigASSyMbuMfzt6_hpFNtMUdgdddU9qRb01KAXLP3mkiuH4df65eHi1VsyiYcfZ05Kj5pWQexcxTNg]mhallen@p...[/url
>> Sent: Thursday, April 25, 2002 11:44 AM
>> To: basicstamps@yahoogroups.com
>> Subject: [noparse][[/noparse]basicstamps] constants
>>
>>
>> hi, another beginner question. How can I use constants to measure the
> > IN of a pin?
> > In other words, i don't want to write
> >
>> x= in7
> >
> > I'd rather write
> >
> > my_input con 7
>> x = in my_input
> >
> >> I can't figure out how to do that without an error...
your dilemma like this:
myInput VAR In7
-- Jon Williams
-- Parallax
In a message dated 4/25/02 12:01:42 PM Central Daylight Time,
mhallen@p... writes:
> hi, another beginner question. How can I use constants to measure the
> IN of a pin?
>
> In other words, i don't want to write
>
>
> x= in7
>
>
> I'd rather write
>
>
> my_input con 7
> x = in my_input
>
>
>
[noparse][[/noparse]Non-text portions of this message have been removed]