Oh Dear, I do hope there's none of your students subscribed to this list realising that teacher hasn't a clue... that aside (I'm just poking friendly fun)... Hey Lester, I got a great money-spinning idea, we need a SUBSCRIPTION ONLY section to this website... where folks can ask embarassing questions in total privacy! Kinda like the PIC/PBP version of your local hospital's Sexual Heath clinic *laughs*... OK, OK, enough Melanie, be a good girl...
if you had MyWordVariable which contained your ten bit ADC, you could simply...
MyByteVariable=MywordVariable/4
or
MyByteVariable=MyWordVariable >> 2
both of which would divide by four happilly without the need for floats.
The best option has already been mentioned, use the PICs ADC in 8-bit mode rather than 10-bit mode.




Bookmarks