piclist 2001\06\02\233917a >
Thread: pic16F877... howto keep in range ?
www.piclist.com/techref/microchip/ios.htm?key=rang
picon face BY : Drew Vassallo email (remove spam text)



>I have a sensor that gives output simular to this:
>empty: 000000100000010
>midfull: 011100011011101
>full: 11101111001111101

Are these individual outputs from a logic-level output?  Or is it a
continuous stream of bits?

>It would be more convenient to have a 0-255 range instead.
>32 bits math is not fun. And takes up much ram for changable limits etc.

If you are polling the sensor for individual logic levels, then why not
simply lengthen your sampling rate so that you count 256 input values in a
3-second time frame?  You don't HAVE to sample it as fast as the PIC allows.
 If it overflows 256, then it's "hot," or if it's < 128, then it's "cold."
Anything else is lukewarm.

I don't see how you have to do 32bit math for this.  Even if you did, it's
only a 32-bit compare, not multiply or divide.  Check the archives for
compare routines.

--Andrew

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics



seeking: brain burp rounding
<F16FCHOzyfyz5b6KZmc00012f15@hotmail.com>

See also: www.piclist.com/techref/microchip/ios.htm?key=rang
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) pic16F877... howto keep in range ?

month overview.

new search...