pic16F877... howto keep in range ?
Drew Vassallo email (remove spam text)
>I have a sensor that gives output simular to this:
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
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
See also: www.piclist.com/techref/microchip/ios.htm?key=rang
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the